title: Use of useSelector redux hooks
body: <p>I made state in redux hooks I don't know how to import or useSelector the state I want</p>
  
  <p><a href="https://i.stack.imgur.com/B4Wji.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/B4Wji.png" alt="enter image description here"></a></p>
  
  <p>Here I am using the useSelector <strong>Send to state</strong> in <strong>Login file</strong></p>
  
  <pre><code>function Login(props) {
  
  var classes = useStyles();
  var dispatch = useDispatch();
  
  const { username, password } = useSelector((state) =&gt; ({
      ...state.combineReducers,
      ...state.userReducer,
  }));
  </code></pre>
  
  <p>And that is <strong>nav file</strong>
  And here I want to <strong>get what's in the state</strong></p>
  
  <pre><code>function nav(props) {
  
      const { username } = useSelector((state) =&gt; ({
          ...state.combineReducers,
          ...state.userReducer,
      }));
  </code></pre>
  
  <p><strong>The error</strong></p>
  
  <pre><code> Failed to compile.
  
  ./src/NAVBAR/nav.js
    Line 27:  React Hook "useSelector" is called in function "nav" which is neither a React function component or a custom React Hook function  react-hooks/rules-of-hooks
  </code></pre>
  
  <p>I have tried in many ways but it fails</p>