title: how to check if my checkbox is checked or not. Ad save it to LocalStorage
body: <p>Im new to programming, just a junior for now.
  I have list of checkboxes. And when I uncheck a checkbox, I want unchecked checkbox to be saved in my local storage. Here is my code snipped, what im doing wrong? Cant fully understand what i wrote. Thank you</p>
  <pre><code>export default () =&gt; {
    const [isDefaultChecked, setDefaultChecked] = useState(true);
    const [isChecked, setChecked] = useState();
    const [isColumn, setColumn] = useState(true);
    const [hiddenColumns, setHiddenColumns] = useState([]);
    const [Checked, setIsChecked] = useState([]);
  const onCheckboxChange = (key: string, value: boolean) =&gt; {
      const array = JSON.parse(localStorage.getItem(&quot;hiddenColumns&quot;));
       // here im trying to check if value = to
      if (value) {
         const column = hiddenColumns.find((item) =&gt; item.value == key);
         const filtered = hiddenColumns.filter(
           (item) =&gt; item.key !== column.key
         )
         setHiddenColumns(filtered);
      
         if (!value) {
         setHiddenColumns([...hiddenColumns, { 'label': key } ]);
       }
  
      localStorage.setItem(&quot;hiddenColumns&quot;, JSON.stringify(key));
     }
    };
  return(
            &lt;div&gt;
              &lt;Checkbox
                defaultChecked={isDefaultChecked}
                label=&quot;Delivery Methods&quot;
                onChange={(value) =&gt; onCheckboxChange(&quot;delieveryMethods&quot;, value)}
              /&gt;
            &lt;/div&gt;
  )
  </code></pre>