Closed nswalters closed 3 years ago
In Apptrakz.js
, define the routes for register and login as follows to resolve:
<Route path="/register" render={(props) => <Register {...props} />} />
<Route path="/login" render={(props) => <Login {...props} />} />
This will pass the props to those components. It also ensures that the useState
hooks in each respective component continue to work as the components are still being rendered as functional components (resolving the Invalid Hook Call - Hooks can only be called inside the body of a function component error).
Register and Login components are using
props.history.push
but don't have access to props.