Adjusting the Register component

Similarly to the Login component, we can also use the useDispatch Hook in the Register component, as shown in the following steps:

  1. Edit src/user/Register.js and import the useDispatch Hook:
import { useDispatch } from '../hooks'
  1. Then, replace the current Context Hook with our custom Dispatch Hook, as shown here:
    const dispatch = useDispatch()

Now the Register component also makes use of our custom Hook instead of directly accessing the dispatch function.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.85.33