save state in local storage

    0

    0

    useEffect(() => {
      setCount(JSON.parse(window.localStorage.getItem('count')));
    }, []);
    
    useEffect(() => {
      window.localStorage.setItem('count', count);
    }, [count]);
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.