September 2018
Intermediate to advanced
764 pages
20h 6m
English
So let’s work on lifting the state up. Currently, we are holding the state in our two form elements. So let’s migrate those local states into the central state we’re keeping inside our Redux store.
Remove the constructor methods inside the LoginForm and RegistrationForm components (these were only used to initialize the states), and update our initialState object to the following:
const initialState = { loginForm: { token: null, email: { value: "", valid: null }, password: { value: "", valid: null } }, registrationForm: { userId: null, email: { value: "", valid: null }, password: { value: "", valid: null } } };
Then, we need to make this central state available to the components. We do this by passing the states down ...
Read now
Unlock full access