Skip to content

Instantly share code, notes, and snippets.

@pictos
Last active January 22, 2019 20:52
Show Gist options
  • Save pictos/c97814a08b04acebf648d4e65be2aa73 to your computer and use it in GitHub Desktop.
Save pictos/c97814a08b04acebf648d4e65be2aa73 to your computer and use it in GitHub Desktop.
// JavaScript
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() {
return (
<Text>{this.state.text}</Text>
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment