Skip to content

hikouki/hey-react-native

Repository files navigation

hey-react-native

CI

Send message to react-native app from react-native-webview.

If not in the react-native-webview, It won't do anything.

Install

npm install hey-react-native

Usage

Please refer to tests.

import { HeyReactNative } from "hey-react-native";

const hey = new HeyReactNative({ debug: true });
hey.emit({ event: 'ping', value: 'pong' });

// => console.log {"event":"ping","value":"pong"}

If you want to specify a event name.

import { HeyReactNative } from "hey-react-native";

const hey = new HeyReactNative<'ping'>({ debug: true });
hey.emit({ event: 'ping', value: 'pong' });

License

hey-react-native is MIT licensed.