componentWillReceiveProps = nextProps => {
if(nextProps.auth.isAuthenticated){
this.props.history.push('/dashboard')
}
if(nextProps.errors){
this.setState({
errors: nextProps.errors
})
}
};
static getDerivedStateFromProps(props, state) {
if (props.message) {
return { message: props.message };
}
}