如何使用withRouter HOC with withFormik来传递来自react-router-dom的历史道具?

时间:2017-12-10 05:03:56

标签: reactjs react-router-dom higher-order-components

我正在使用doc来验证React中的表单。我想知道如何将 withRouter HOC的历史道具传递给 withFormik HOC?

{{1}}

通过运行上面的代码,我收到以下错误:

  

警告:setState(...):只能更新已安装或已安装   零件。这通常意味着您在已卸载时调用了setState()   零件。这是一个无操作。请检查Formik的代码   成分

1 个答案:

答案 0 :(得分:0)

您缺少EnhancedForm的渲染功能。

withRouter文档在这里: https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/api/withRouter.md

相关问题