Cannot update during an existing state transition

假如想象 提交于 2019-12-01 12:13:24
oobgam

John says: Change onClick={_this.clickLoadForm(applicationform._id)} to onClick={_this.clickLoadForm.bind(_this,applicationform._id)}

If that doesn't work, then maybe some variation of the below


Try changing _this.clickLoadForm(_this.props.router.params.appid) to _this.clickLoadForm

<a  onClick={_this.clickLoadForm}
    data-value={_this.props.router.params.appid}
    href={Meteor.absoluteUrl()+'application/' +applicationform._id}
    key={"a"+i}>
    Version {applicationform._id}
</a>


clickLoadForm(e) {
    var appId = e.target.dataset.value;
    var currentApp = this.loadForm(appId);
    this.setState({input_36:currentApp.input_36});
}

It seems like you're already executing the clickLoadForm function thus triggering this.setState

maybe change to "onClick={_this.clickLoadForm.bind(_this,_this.props.router.params.appid)}"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!