1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-22 17:33:14 +01:00

Check for a new csrf token on componentWillReceiveProps instead of componentWillUpdate

this.setState() should not be used in componentWillUpdate():
https://facebook.github.io/react/docs/component-specs.html#updating-comp
onentwillupdate
This commit is contained in:
Brett Sun 2015-11-02 12:10:41 +01:00
parent 5f5461c10d
commit 49f20462f1

View File

@ -202,7 +202,7 @@ let ReactS3FineUploader = React.createClass({
};
},
componentWillUpdate() {
componentWillReceiveProps() {
// since the csrf header is defined in this component's props,
// everytime the csrf cookie is changed we'll need to reinitalize
// fineuploader and update the actual csrf token