title: context updating method not being reached
body: <p>I am doing my first typescript/context but for some reason, the code to update the context is not reachable:</p>
  <pre><code>import PropTypes from 'prop-types';
  import { createContext, ReactNode, useState } from 'react';
  
  
  
  export const VContext = createContext({
    setValue: () =&gt; { },
    getValue: () =&gt; { },
  });
  
  export const VProvider = ({ children }: {children: ReactNode}) =&gt; {
    const [activeValue, setActiveValue] = useState(false);
  
    //never reaching this
    const setValue = () =&gt; {
      console.log(activeValue);
      setActiveValue(!activeValue)
    };
  
   
    return (
      &lt;VContext.Provider
        value={{
          setValue,
          getValue: ()=&gt; activeValue
        }}&gt;
        {children}
      &lt;/VContext.Provider&gt;
    );
  };
  
  VProvider.propTypes = {
    children: PropTypes.instanceOf(Object).isRequired
  };
  </code></pre>
  <p>App.tsx</p>
  <pre><code> &lt;VProvider&gt;&lt;MyButton /&gt;&lt;/VProvider&gt;
  </code></pre>
  <p>MyButton.tsx</p>
  <pre><code>const { setValue, getValue } = useContext(VContext);
  
  return(&lt;div&gt;&lt;p&gt;{getValue()}&lt;/p&gt;&lt;button onClick={setValue}/ type=&quot;button&quot;/&gt;&lt;/div&gt;);
  </code></pre>
  <p>while no error is thrown, setValue doesn't seem to be reached since even throw Error in the method doesn't throw error nor the console log.</p>
  <p>what am I missing?</p>