-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Native support #5
Comments
Hey @madmod, glad you like it. I'd be happy to add RN support. I think following the convention of pusher is probably best, i.e. In the meantime, you can pass your own value into the import React from 'react'
import Pusher from 'pusher-js/react-native'
import { PusherProvider } from '@harelpls/use-pusher'
export const NativePusherProvider = props => {
// store it in state so if you need to listen for auth changes
// you can reinitialise and resubscribe to channels
const [client] = useState(new Pusher("key", {}))
return <PusherProvider value={{ client, triggerEndpoint: "" }} {...props} />
} First class support would be ideal though. I'll stick it in the pipeline! |
Thanks for your patience here! React native support has been released at 5.0.0. |
great work @mayteio ! |
Let me know how you go with it. I only wrote tests for it 🙃 didn’t use it in an actual example. |
This module is really great. Is there any chance it could be made to support React Native? Maybe in PusherProvider it could use require and choose between
pusher-js
andpusher-js/react-native
? Or you could pass in a custom Pusher and requirepusher-js
if one wasn't provided?The text was updated successfully, but these errors were encountered: