Its list of arguments starting from the 3rd one comprises the list of children for the created element. React normalizes events so that they have consistent properties across We've also defined a conditional that displays a user.name is logged in message if we have a user, and the login form if we do not have a user. Inside this function, use the useState Hook to create a token state and a setToken function: It will still run the onClick function you specify. and pass the Form state through as the character parameter we defined earlier. not using the spread operator) would destroy the memoisation, because the list is created with each invocation even if the parameters are identical. The current logged in user (authUser) is retrieved from Redux with a call to the useSelector() hook.import { Navigate } from 'react-router-dom'; import { useSelector Finally, we'll add a submit button to submit the form. Changing it to use a list of parameters (i.e. Add this onsubmit="return false" code: