title: What is correct way to fix this 'Invalid Hook Call' error in react app?
body: <p>Well, i have this error </p>
  
  <pre><code>Error: Invalid hook call. Hooks can only be called inside of the body of a function component. 
  </code></pre>
  
  <p>I tried alot of different options to fix this, but i failed. </p>
  
  <p>Here is my code </p>
  
  <pre><code>export const DataInput = () =&gt; {
  
      const Post = (testTitle, testText) =&gt; {
              useFirestore().collection('schedule-data').doc('test').set({
                  testTitle: testTitle,
                  testText: testText
              })
           }
      return(
          &lt;Button 
             variant="primary"
             onClick={()=&gt; Post(testTitle, testText)}&gt;
             POST data
          &lt;/Button&gt;
  </code></pre>
  
  <p>Deleted some of code that does not matter </p>