title: React Hook "useSelector" is called in function
body: <p>I cannot figure out what going on with "useSelector" I need little help, please.</p>
  
  <p><strong>ERROR</strong></p>
  
  <blockquote>
    <p>React Hook "useSelector" is called in function "render_user" which is neither a React function component or a custom React Hook function</p>
  </blockquote>
  
  <pre><code>class Navigationbar extends Component {
  
    onLogoutClick = e =&gt; {
      e.preventDefault();
      this.props.logoutUser(); //this.props.
    };
  
    render() {
        const render_user = () =&gt; {
  
          const auth = useSelector(state =&gt; state.auth); Error Message is here
          //More Code Here
        );
      };
    } 
  
  </code></pre>
  
  <pre><code>Navigationbar.propTypes = {
    logoutUser: PropTypes.func.isRequired,
    auth: PropTypes.object.isRequired
  };
  
  const mapStateToProps = state =&gt; ({
    auth: state.auth
  });
  
  export default connect(
    mapStateToProps,
    { logoutUser }
  )(Navigationbar);
  </code></pre>