Skip to content

Using transmit-client with React-Native App #4488

Answered by Julien-R44
rhnkyr asked this question in Help
Discussion options

You must be logged in to vote

I think, React Native doesnt have a builtin EventSource API

So what you can do is use this package https://github.com/binaryminds/react-native-sse which provides an EventSource for react native, and pass it in when creating your transmit client instance

import EventSource from "react-native-sse";

const transmit = new Transmit({
  baseUrl: 'http://localhost:3333/',
  eventSourceConstructor: EventSource
})

And it should work fine

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Julien-R44
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants