From 321685209eb34d3e79a6b3e789b14718beab646d Mon Sep 17 00:00:00 2001 From: Dheeraj Kumar Date: Fri, 19 Jun 2015 23:04:18 +0530 Subject: [PATCH] Fix incorrect code sample getInitialState and componentDidMount were nested inside the render method. --- website/src/react-native/index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/website/src/react-native/index.js b/website/src/react-native/index.js index 382d5ab1ff9c75..f587067c7918ee 100644 --- a/website/src/react-native/index.js +++ b/website/src/react-native/index.js @@ -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 ( {this.state.text} ); - }, + } });`}