Commit 9a161e43 by Zhang Xin

fix props

parent ecfdaeb0
...@@ -8,6 +8,12 @@ export default class TextAreaContainer extends React.Component{ ...@@ -8,6 +8,12 @@ export default class TextAreaContainer extends React.Component{
text : '' text : ''
} }
} }
componentWillReceiveProps(nextProps){
let text = nextProps.text ? nextProps.text : ''
this.setState({
text : text
})
}
handleChange(e){ handleChange(e){
let value = e.target.value let value = e.target.value
this.setState({text: value}); this.setState({text: value});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment