![]() ![]() native-base: a UI library that will be used for look and feel of our app.Install dependencies: npm i react-navigation react-native-gesture-handler react-native-fullwidth-image native-base rambdaxīelow is the list of installed dependencies and their uses: Start a new project: react-native init MovieDirectory If you want to skip this part then clone the source repo and checkout the v0.0 branch. ![]() Note: you may be able to use it with ExpoKit or Ejecting from Expo. We’re going to use react-native-cli to create our application. ![]() We just need to conform to the WatermelonDB sync protocol on the back end and provide the endpoints. It makes it pretty easy to use with any of our own back-end databases. It uses lazy loading and SQLite as an underlying database on a separate thread to provide a fast response.Īlthough WatermelonDB is just a local database, it also provides sync primitives and sync adapters. To overcome this, WatermelonDB doesn’t fetch anything until it’s needed. Due to all these factors, JavaScript apps run slower in a mobile application. Also, the hardware in mobile devices is slower than in computers. In a modern browser, just-in-time compilation is used to improve speed, but it’s not available in mobile devices. We make the changes in the object and our job’s done! It’s persisted and updated at all the places in the application. In my experience, it just works seamlessly, and we don’t have to care about anything else. We wrap the simple React components and enhance them to make them reactive. We don’t have to make any extra efforts to use WatermelonDB. Any object can be observed using observables, and it will automatically rerender our components whenever the data changes. ![]() Let’s look at some of the features of WatermelonDB.Ī great feature of WatermelonDB is its reactive nature. We need to create an offline-first application, so a database is a must. The React Native community has also started promoting it, but I haven’t come across a large-scale, production-ready application that uses Expo yet, and Expo port isn’t currently available for those using a database such as Realm - or in our case, WatermelonDB. Note: there’s a more JavaScript-friendly toolchain named Expo. To set up a virtual device or physical device, follow these guides: As the official guidelines are very concise and clear, we won’t be covering that topic here. Note: you can check out the official guide for installing dependencies here for more information. I’d also suggest setting up an Android or iOS development environment while setting up the project, as you may face many issues, and the first step in debugging is keeping the IDE (Android Studio or Xcode) opened to see the logs. I assume you have knowledge about basic React Native and its build process. It has good documentation, a good rating on GitHub (> 9K stars), and is also reactive. RxDB: a real-time database for the Web.But it does require you to stay within their ecosystem to utilize it. It offers lots of functionality, storage being just one of them. FireBase ( React Native, Expo): a Google service specifically for the mobile development platform.They have done a great job and many well-known companies use it. Realm ( React Native): an open-source solution, but it also has an enterprise edition with lots of other features.It’s available for most of the platforms, so if you’ve developed an application in another mobile app development framework, you might already be familiar with it. SQLite ( React Native, Expo): the oldest, most used, battle-tested and well-known solution.By default, it uses SQLite as the underlying database in React Native. WatermelonDB: an open-source reactive database that can be used with any underlying database.Below are some of the best known options available for React Native: If two options are available, then go with the one that has better documentation and quicker response to issues. When developing an app, choose the database that best fits your requirements. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |