Event bus for react native, cross-interface communication solution, it works on iOS and Android.
- 1.Run
npm i react-native-event-bus --save
- 2.
import EventBus from "react-native-event-bus"
Add react-native-event-bus
to your js file.
import EventBus from "react-native-event-bus"
Inside your component"s render method, use CheckBox:
EventBus.getInstance().fireEvent("your event name", {
...params
})
//
componentDidMount() {
EventBus.getInstance().addListener("your event name", this.listener = data => {
// handle the event
})
}
componentWillUnmount() {
EventBus.getInstance().removeListener(this.listener);
}
Issues are welcome. Please add a screenshot of bug and code snippet. Quickest way to solve issue is to reproduce it on one of the examples.
Pull requests are welcome. If you want to change API or making something big better to create issue and discuss it first.
MIT Licensed