-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
It's not clear to me how one would send a message to the browser using Lepont when a user clicks for example in a button on the React Native side.
From what I can see one needs to call bridge.sendMessage but bridge is inside all this:
const [ref, onMessage] = useBridge((registry) => {
registry.register('my-streaming-bridge', (_, bridge) => {
bridge.sendMessage({
type: 'my-streaming-event',
payload: 'stream data!',
})
})
})Am I supposed to do something like this?
let stream = null;
const [ref, onMessage] = useBridge((registry) => {
registry.register('my-streaming-bridge', (_, bridge) => {
stream = bridge.sendMessage;
})
})
stream({
type: 'my-streaming-event',
payload: 'stream data!',
});Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels