Skip to content

Instantly share code, notes, and snippets.

@holin
Created June 9, 2017 08:44
Show Gist options
  • Save holin/973bffc4d13a1dc3171c8f00a70ef968 to your computer and use it in GitHub Desktop.
Save holin/973bffc4d13a1dc3171c8f00a70ef968 to your computer and use it in GitHub Desktop.
react native

EventEmitter

http://www.ghugo.com/react-native-event-emitter/

var RCTDeviceEventEmitter = require('RCTDeviceEventEmitter');

RCTDeviceEventEmitter.emit('change',text);

RCTDeviceEventEmitter.addListener('change',function(text){ me.setState({ text : text }) })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment