You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-07 10:46:24 +03:00
Fix TS definitions
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
@@ -26,7 +26,7 @@ const getValue = <T>(key: string, initialValue: T): T => {
|
||||
};
|
||||
|
||||
// Hook behaving like useState but persisting the value to localStorage. Returns same as useState
|
||||
export const useLocalStorageState = <T>(key: string, initialValue: T) => {
|
||||
export const useLocalStorageState = <T>(key: string, initialValue: T): [T, Dispatch<SetStateAction<T>>] => {
|
||||
const lsKey = "mx_" + key;
|
||||
|
||||
const [value, setValue] = useState<T>(getValue(lsKey, initialValue));
|
||||
|
||||
Reference in New Issue
Block a user