【问题标题】:How to redirect after summit form提交表单后如何重定向
【发布时间】:2017-06-20 15:40:00
【问题描述】:

因为 react-router v4 不能使用 'browserHistory' 那我该怎么办?如果我想在峰会表格后转到下一页。这是我的代码

let Profile = ({ history, handleSubmit }) => {
return (
    <FirstSec>
        <div>
            <p>Profile</p>
            <form onSubmit={handleSubmit(submit)} >
                <div className="form-group">
                    <Field name="firstName" type="text" className="form-control" label="first name" component={renderField} />
                    <Field name="lastName" type="text" className="form-control" label="last name" component={renderField} />
                    <Field name="tel" type="tel" className="form-control" label="tel" component={renderField} />
                    <Field name="email" type="email" className="form-control" label="email" component={renderField} />
                </div>

                <button onClick={() => history.push('/apply/1/Occupation')}>Back</button>
                <button type="submit">Next</button>
            </form>
        </div>
    </FirstSec>
);

};

个人资料 = reduxForm({ 形式:'个人资料' })(轮廓);

【问题讨论】:

    标签: reactjs redux redux-form


    【解决方案1】:

    你应该使用React-redux-router

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-04-13
      • 1970-01-01
      • 2020-09-13
      • 2020-03-06
      相关资源
      最近更新 更多