Fix incorrect code sample
getInitialState and componentDidMount were nested inside the render method.
This commit is contained in:
parent
a6b6f97ba1
commit
321685209e
|
@ -187,7 +187,6 @@ var React = require('react-native');
|
||||||
var { NativeModules, Text } = React;
|
var { NativeModules, Text } = React;
|
||||||
|
|
||||||
var Message = React.createClass({
|
var Message = React.createClass({
|
||||||
render: function() {
|
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return { text: 'Goodbye World.' };
|
return { text: 'Goodbye World.' };
|
||||||
},
|
},
|
||||||
|
@ -196,10 +195,11 @@ var Message = React.createClass({
|
||||||
this.setState({text});
|
this.setState({text});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
render: function() {
|
||||||
return (
|
return (
|
||||||
<Text>{this.state.text}</Text>
|
<Text>{this.state.text}</Text>
|
||||||
);
|
);
|
||||||
},
|
}
|
||||||
});`}
|
});`}
|
||||||
</Prism>
|
</Prism>
|
||||||
<p>
|
<p>
|
||||||
|
|
Loading…
Reference in New Issue