WZ
Size: a a a
WZ
IL
RM
IK
RM
IK
IK
VK
OD
RM
v
ДД
ДД
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];
};
WZ
M
M
I
M
M