I have a form which disables the 'save' button when any of the fields are invalid, however the color of the save button is out of sync with its state. It correctly can't be pressed when disabled, and the zIndex is right too, however the color is wrong.
I did some digging and it looks like the problem might be that RaisedButton.componentWillReceiveProps calls getStyles(), but getStyles reads from this.props which clearly isn't up to date at this point.
Perhaps the call to this.styles = this.getStyles(); should be delayed until render() or something?
I have a form which disables the 'save' button when any of the fields are invalid, however the color of the save button is out of sync with its state. It correctly can't be pressed when disabled, and the zIndex is right too, however the color is wrong.
I did some digging and it looks like the problem might be that
RaisedButton.componentWillReceivePropscallsgetStyles(), but getStyles reads fromthis.propswhich clearly isn't up to date at this point.Perhaps the call to
this.styles = this.getStyles();should be delayed untilrender()or something?