title: Will Redux in React work only with Functional Components?
body: <p>I have been doing some learning of React and have been developing projects. I recently started of with Redux, and so, wanted to develop my next project using it. I set it up perfectly fine, and for one component in the app, I thought, why can't I have a class component in it. I tried the same and it threw up a lot of errors.</p>
  
  <p>So I want to know, will react-redux only work with functional components and not class components. and if so, it would be great if you can explain why?</p>
  
  <p>For example:
  I can't seem to declare the selectors inside the class component. When I declare a variable as follows: </p>
  
  <pre><code>const play = useSelector((state) =&gt; state.play); 
  </code></pre>
  
  <p>It throws the following error: </p>
  
  <blockquote>
    <p>Error: Invalid hook call. Hooks can only be called inside of the body
    of a function component.</p>
  </blockquote>