Next, we are going to adjust the Register component with the following steps:
- Edit src/user/Register.js and adjust the import statement to also import the useAPIRegister Hook:
import { useDispatch, useAPIRegister } from '../hooks'
- Then, replace the current Resource Hook with the following:
const [ user, register ] = useAPIRegister()
Now the Register component uses our custom API Hook to register users via the API.