From 2a88302ef957c5bf6798da64339a2213efac58ad Mon Sep 17 00:00:00 2001 From: Sean Miller Date: Tue, 20 Jan 2015 23:49:11 -0800 Subject: [PATCH] raisedButton will reset state when receives new props --- src/js/raised-button.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/js/raised-button.jsx b/src/js/raised-button.jsx index 2de475c3ce5c8c..f3e4e05b7d9ac3 100644 --- a/src/js/raised-button.jsx +++ b/src/js/raised-button.jsx @@ -27,6 +27,14 @@ var RaisedButton = React.createClass({ }; }, + componentWillReceiveProps: function(nextProps) { + var zDepth = nextProps.disabled ? 0 : 1; + this.setState({ + zDepth: zDepth, + initialZDepth: zDepth + }); + }, + render: function() { var { label,