pd
Size: a a a
pd
С
С
С
E
E
A
$
A
E
A
E
E
$
VC
const useFormPersist = (key) => {
const getValue = useCallback(() => {
try {
if (typeof localStorage !== "undefined") {
const persistValue = JSON.parse((localStorage.getItem(key)));
localStorage.removeItem(key);
return persistValue;
}
} catch {
return null;
}
}, [key]);
const setValue = useCallback((value) => {
try {
if (typeof localStorage !== "undefined") {
localStorage.setItem(key, JSON.stringify(value));
}
} catch {}
}, [key]);
return [getValue, setValue];
};
OH
OH
П
П
П