Fix incorrect code sample

getInitialState and componentDidMount were nested inside the render method.
This commit is contained in:
Dheeraj Kumar 2015-06-19 23:04:18 +05:30
parent a6b6f97ba1
commit 321685209e
1 changed files with 9 additions and 9 deletions

View File

@ -187,19 +187,19 @@ var React = require('react-native');
var { NativeModules, Text } = React;
var Message = React.createClass({
getInitialState() {
return { text: 'Goodbye World.' };
},
componentDidMount() {
NativeModules.MyCustomModule.processString(this.state.text, (text) => {
this.setState({text});
});
},
render: function() {
getInitialState() {
return { text: 'Goodbye World.' };
},
componentDidMount() {
NativeModules.MyCustomModule.processString(this.state.text, (text) => {
this.setState({text});
});
},
return (
<Text>{this.state.text}</Text>
);
},
}
});`}
</Prism>
<p>