Skip to content

Commit

Permalink
fix: use a type assertion to ensure compatibility between setItem in …
Browse files Browse the repository at this point in the history
…StorageContextData
  • Loading branch information
AssahBismarkabah committed Mar 11, 2024
1 parent 44e30a8 commit 4f189c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion power-pay-frontend/src/hooks/StorageContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function StorageProvider<T>({ initialValue, children }: PropsWithChildren
};

// Destructure getItem and setItem before using them in the StorageContext.Provider value prop.
const contextValue: StorageContextData<T> = { getItem, setItem };
const contextValue: StorageContextData<unknown> = { getItem, setItem } as StorageContextData<unknown>;

return (
<StorageContext.Provider value={contextValue}>
Expand Down

0 comments on commit 4f189c2

Please sign in to comment.