Answer the question
In order to leave comments, you need to log in
The value for the user changes, what's wrong?
action:
export const login = () => {
return {
type: 'LOGIN'
}
}
const user = (state = false, action) => {
switch(action.type) {
case 'LOGIN':
return !state;
default:
return state;
}
}
export default user;
import { combineReducers } from 'redux';
import user from './user.js';
const allReducers = combineReducers({
user
})
export default allReducers;
true
onSubmit={() => dispatch(login())}
<form onSubmit={() => dispatch(login())} className="auth__content-form" action="/auth/login" method="POST">
<input type="email" placeholder="Электронная почта" name="email" required />
<input type="password" placeholder="Пароль" name="password" required />
<input type="submit" value="Войти" />
</form>
false
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question