nextjs localstorage

useEffect(() => {
    // setter
    localStorage.setItem('myData', data);
    // getter
    localStorage.getItem('myData');
    // remove
    localStorage.removeItem('myData');
    // remove all
    localStorage.clear();
}, [])
Radmehr Aghdam