I have really been having a hard time intergrating firebase to my react-native UI.
Anyone who knows where(site, video or course) that one can learn how to use firebase as react native's backend?
Cheers!
you can use firebase as backend with their data base etc,
check out this blog https://rnfirebase.io/ , you will get to know about the different functionalities which you can integrate with firebase in RN
Related
at my company we have a react native app. now we want to make so that some of that functionality, basically a component accessible via react-navigation/bottom-tabs, is also accessible via web.
from what I understand we have 2 options:
refactor that into a web app and then integrate it back into the app as a web view
use react native web to port that component part of the app for the web. here I would have really no idea how to proceed and if that is possible at all
am I missing out on something? do you have any other suggestion?
thanks!
I have setup a simple Amplify backend API and connected it to a React Native frontend. Now I want to connect it to a React frontend.
Could I extract all of the Amplify code into its own project to be used by both frontends? I want to avoid code duplication as much as possible. Has anyone done this before?
This is a supported feature. You can read all about it in the docs about multiple front-ends
Despite React and React Native can share the same Amplify backend, according to my research, if your application has federated sign in, you must create two different stages for them, because of the Sign-in and Sign-out redirection url, React takes http://xxxx but React Native takes myapp://.
I want to create a mobile app in react native with firebase backend. Data should be added from admin panel(in react) and only authenticated users will see that data.how i can achieve that.
Note : - both react native and react app should use same firebase project
Yes it is possible you need to use Firebase auth, Firestore, and any other components you want like media just make sure to make all components public false so anyone can not edit anything.
Then config React-Native and React-Js firebase with the same project.
after that anything you'll from react-js and it'll be shown in React-Native mobile project.
I am creating React Native App for mobile on Expo.
When we try to make mobile Apps, we should usually manage state in this app.
However, I am using Expo. Of course, Expo is useful to start React Native App easily and quickly but sometimes Expo cannot accept modules.
So, in this case, I tried to use Realm to manage state but Expo can't follow this.
Could you teach me which way for state management is better in React Native on Expo?
There's a few ways to go about this, two of which I know and have used:
AsyncStorage: This is default with react-native and you won't need to install anything to use it, here's a few tutorials and documentation on it.
https://facebook.github.io/react-native/docs/asyncstorage
https://medium.com/building-with-react-native/what-is-asyncstorage-in-react-native-and-how-you-to-use-it-with-app-state-manager-1x09-b8c636ce5f6e
https://medium.com/#richardzhanguw/storing-and-retrieving-objects-using-asyncstorage-in-react-native-6bb1745fdcdd
React-Redux: This is something I use a lot more, it utilises AsyncStorage but allows you to create a better storage flow and a system of persisting data so when you close the app and reopen it, the data will still be there. I've found React-Redux to be a lot easier once properly learned, here's a few documentations on it.
http://www.reactnativeexpress.com/redux
https://alligator.io/react/react-native-redux/
https://medium.com/#relferreira/react-native-redux-react-navigation-ecec4014d648
A quick google search on either (react native using react redux or react native using async storage) will give you quite a few documentations/tutorials that is quite useful and you always have Stackoverflow, if you're ever stuck.
there are multiple ways
redux (https://redux.js.org/)
mobx (https://mobx.js.org/intro/overview.html)
react context API (https://reactjs.org/docs/context.html)
for small apps, i prefered use react context and for an app with a large scale I using redux
What is a good approach for making a React web and a React Native app that share their APIs for consuming the same database?
The system will have some CRUD screens for managing products and their images as well diferent events that the user will save.
I will follow the component / container pattern with Redux to be able to reuse code.
I am working in Windows SO.
I was thinking in:
NodeJs (APIs) and Heroku server
MongoDB
React (web app)
React Native (mobile app)
Are there some common archetypal model when using React and React Native consuming the same apis and DB?
I know I'm going to get flamed for this one....Even though it's not persistant to what you asked. I started a new project where we are using Firebase as our cloud backend and it works seamlessly between the web, ios, and android versions (building in react native).
But in regards to your question, react and react-native work well together, You can setup your redux actions (in react-native) almost identical to your react web app. The only differences between how you want to query your backend and handle auth (native uses asyncStorage vs localstorage/cookies). React native has a built in Fetch vs any other React package like Axios or SuperAgent.