Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

hey-react-native

hikouki4MIT1.0.0

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

typescript, react-native, react-native-webview, emit, event, message

readme

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.