I made state in redux hooks I don't know how to import or useSelector the state I want
Here I am using the useSelector Send to state in Login file
function Login(props) {
var classes = useStyles();
var dispatch = useDispatch();
const { username, password } = useSelector((state) => ({
...state.combineReducers,
...state.userReducer,
}));
And that is nav file And here I want to get what's in the state
function nav(props) {
const { username } = useSelector((state) => ({
...state.combineReducers,
...state.userReducer,
}));
The error
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
I have tried in many ways but it fails
