I am new to ReactJs. This is my code:
var React = require(\'react\');
var ReactDOM = require(\'react-dom\');
var {Route, Router, IndexRoute, hashHistory} = requ
I also write a Login practice. And also meet the same question like you. After a day struggle, I found that only this.props.history.push('/list/')
can make it instead of pulling in a lot of plugins. By the way, the react-router-dom
version is ^4.2.2
. Thanks!
handleSubmit(e){
e.preventDefault();
this.props.form.validateFieldsAndScroll((err,values)=>{
if(!err){
this.setState({
visible:false
});
this.props.form.resetFields();
console.log(values.username);
const path = '/list/';
this.props.history.push(path);
}
})
}