-
Notifications
You must be signed in to change notification settings - Fork 36
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
Add React Native adaptor #46
base: main
Are you sure you want to change the base?
Conversation
@pie6k thank you so much for the review! I managed to get rid of all untyped imports except |
|
||
export default async function adaptor() { | ||
const firestore = nativeFirestore() | ||
// At the moment, the React Native Firebase adaptor doesn't support getAll. | ||
if (!('getAll' in firestore)) Object.assign(firestore, { getAll }) | ||
return { | ||
firestore, | ||
consts: { DocumentReference, Timestamp, FieldValue } | ||
consts: { | ||
DocumentReference, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like DocumentReference is indeed not exported from public API of the package...
@pie6k did you have a chance if It worked? 🤞 |
Hi! I'm using typesaurus with firebase(web) package on react-native. It works well. However if this pull request will merge, I can't use firebase(web) with react-native. Can I switch adopter by manually? for example interface.
|
@hotchpotch that's terrible news but great timing! I guess I have to figure out how to make them all work together. It's not possible to change adaptor on the web, but even if I add the ability, your case will break with an error "missing react-native-firebase". So I don't think that's an option. @pie6k I'm wondering tho, what's the advantages of react-native-firebase over the web firebase package? |
Hey, sorry for not testing your PR deeper. I switched to different approach and didn't have time to play with it. There are quite a lot of advantages of using it over web based lib in React Native
|
I think
I'm using @firebase/firestore with react-native (with Expo). So I would be happy if there was a way to select |
I looked into about dynamic import with react-native. Currently (react-native <=0.62) , it is not work yet.
However, next react-native version 0.63, Dynamic import will probably work.
Example implmention |
Hi! |
Add experimental React Native adaptor.