I want to check if the token exists. If there is no token, I redirect the user to the login page Because I use the hook, the useNavigate command gives an error, as well as the command history.push( (https://i.stack.imgur.com/sCxM9.png) (https://i.stack.imgur.com/XOcHo.png)
action.props.history.push('/') dont work