tsc
This commit is contained in:
parent
491f38b120
commit
823f739c32
1 changed files with 2 additions and 3 deletions
|
@ -1,11 +1,10 @@
|
|||
import { LS_KEYS, getData, setData } from "@ente/shared/storage/localStorage";
|
||||
import type { Dispatch, SetStateAction } from "react";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export function useLocalState<T>(
|
||||
key: LS_KEYS,
|
||||
initialValue?: T,
|
||||
): [T, Dispatch<SetStateAction<T>>] {
|
||||
initialValue: T,
|
||||
): [T, (newValue: T) => void] {
|
||||
const [value, setValue] = useState<T>(initialValue);
|
||||
|
||||
useEffect(() => {
|
||||
|
|
Loading…
Add table
Reference in a new issue