5

9 reasons to choose React-Native in 2022

 1 year ago
source link: https://medium.com/sunstack/9-reasons-to-choose-react-native-in-2022-99996de3c4e7
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
1*YCpA-D6-NKm8icLVb4VdOg.png

9 reasons to choose React-Native in 2022

I’ve been working on React-Native since version 0.16, and boy how far the framework went in so little time. I’ve seen the core packages get split through the Lean Core effort, the birth of Hermes, the use of Cocoapods as a standard (it hasn’t always been this way), the evolution of Metro, the jetifying of old Android packages and, least to say, the birth of autolinking.

Are we done yet ? Certainly not. This is the era of Turbo Modules that load when necessary, JSI that get rid of the bridge and makes animations smoother than they used to be, and the new Fabric engine that uses JSI in order to smoothen the rendering process.

Amidst all the frameworks out there getting their hour of fame (most importantly Flutter), React-Native still shines by its elegance and its simplicity, more than ever consolidating the React’s Mantra : Build once, use everywhere.

And here are the 9 reasons I’m still a React-Native player.

1. It’s fast

React-Native is amazingly performant.

The first and most important promise of React-Native lies in its usage of Native components. When you’re rendering a View, a Text or a ScrollView, you’re really rendering a native UI Component. The bottleneck lies in the exchange between the JS realm and the Native realm. In between of them sits the React reconciliation algorithm that takes care of computing only the necessary steps required for the app to reflect the next state of the UI.

Beside all that works, React-Native is amazingly performant. Some problems may arise, most importantly when dealing with long lists, big images or maps with a lot of pins for example, all of which are solvable with a bit of engineering that might involve some native knowledge. All in all, you’re never stuck in a performance problem that the framework wont let you solve : the power is always inside your hands.

2. It’s fun to work with

Diving into the intricacies of the native platform was just too much noise and responsibility.

Have you ever built native Android/Java or iOS/ObjectiveC/Swift apps ? It’s painful, mainly when your UI needs are over what’s supported by the native platform. The native layout engine is a pain to compose with and the level of details you have to deal with is more than you should need to worry about. I had fun building logic in Android, but diving into the intricacies of the native platform to tie multiple fragments in different places together was just too much noise and responsibility.

React-Native is something else. It’s so pure and beautiful, probably it’s the Functional Programmer Nirvana of the UI world. You can compose any type of app, with the UI that suits your aesthetic sense, and no one can prevent you from doing so. Even Apple, known for being strict on UI, has evolved and is now keen on letting you style your app the way you want, as long as it respects some basic UX principles. Have you ever tried animating in Java ?

3. It’s Portable

One single codebase will get you an Android app, an iOS app, a MacOS app, a Windows App and a Website running.

Startups and small teams don’t want to spend money on different people working in different codebase, using different languages and having to maintain multiple sources of the same program in order to reach a maximum of client. How many times businesses had to plan for one app before the other in order to validate their idea, but had to make a choice between Android and iOS ? Anyway, it’s no longer necessary.

With React-Native, you can have your cake and eat it. Hell, you can even buy the whole bakery, the milk and the cows with it. One single bloody codebase will get you an Android app, an iOS app, a MacOS app, a Windows App and a Website running.

With. One. Single. Codebase.

It sure gets more difficult when dealing with native modules, but the most used ones are pretty much available everywhere.

4. It’s Isomorphic

You can use React to build UI virtually anywhere : it’s platform agnostic.

It’s not a big word, it just means you can reuse components from your web app inside your React-Native app, as long as your web app is built using React. Fun thing, you can use React to build UI virtually anywhere : it’s platform agnostic. People built UIs on Consoles (PlayStation, Xbox), Video Games (EA) and even ATMs (alright, it’s a wild “guess”).

That’s powerful because you can reinforce your branding and your design system by isolating your set of UI components and reuse them. Stronger than that, you can even recycle hooks and business logic for reuse in your React-Native app. Things can get as far as sharing more than 50% of your code between your web app and your mobile app.

5. It can update without using the store

You can even update your app many times a day.

This one is a no-brainer : using OTA (Over The Air) updates, you can update your code and release it without the stores having their word. Doing so, you can fix bugs, try things and release features without no one noticing. You can even embed your own release logic and ensure everyone is using the latest version of your app (and eventually drop the need for backward compatibility in your API).

Do you hear that back-end engineers ? No more versioning.

Just kidding, should still version your API. But you can be less stressed and have shorter cycles between migrations. With proper CI/CD and a good test suite, you can even update your app many times a day. So far, CodePush is the top one contender in the OTA world.

6. You can prototype quickly

JavaScript’s essence and structure allows you to create complex functions and compose UI with ease.

It’s so easy to get up and running you can draft MVPs in a matter of a week-end for hackathon. Tons of libraries can help you with the task, most notably UI Kits, Navigation, Native Modules and Cloud clients (AWS Amplify or RNFirebase for example). Setup an AppCenter account, abuse the free tier for your CI/CD pipeline, deploy via e-mail or use TestFlight/PlayConsole Beta and you’re good to go.

JavaScript is such a terrific language for prototyping (not puns intended). Its essence and its structure allows you to create complex functions and compose UI with ease. You no longer have to fight the compiler, think about classes, objects, signals and all the native cumbersome jargon to kickstart your next project. JavaScript will never (rarely) step between you and your goal. Just beware of not shooting yourself on the foot (and use TypeScript).

7. There’s plenty of resource to help you

React-Native has a lot of support to offer : tutorials, packages, forums, dedicated teams, youtube videos, podcasts…

Being a long-time contender of the Mobile Cinematic Universe, React-Native has a lot of support to offer : tutorials, packages, forums, dedicated teams, youtube videos, podcasts… Over more than 100k questions lies in StackOverflow. It’s also very easy to find React-Native developers world wide and increase your engineering force. Even better, most of them can also contribute to your front-end on the web.

There’s one drawback though : without some knowledge of Native code, you might find yourself in terrible situations, mainly when upgrading React-Native. Efforts have been put to simplify the process, but we’re not here yet. Hence, you are encouraged to stay up to date with the latest releases (roughly every two months).

8. It’s incrementally adoptable

You can adopt React-Native at a small scale and increase its surface area one step at a time.

Already have a native app ? We got you covered : you can start adding React-Native to a single part of your application (such as a Scene, or a whole sub-part of your app). Thus, you can test it at a small scale and increase its surface area one step at a time. Leaves you plenty of time to go back in case you’re not satisfied.

9. Big Companies put their effort on it

Facebook, Instagram, Discord, Coinbase, Shopify, Skype, Pinterest, Bloomberg, Pinterest, Wix, Tesla, Uber, Salesforce, Microsoft… the list goes on and on. Be it to build a whole app, part of an app or just an internal tool, many big names use it. While this isn’t a proof of excellence per se, it’s a least a proof of interest. Engineers from these top companies not only invested time and money, they also contributed back to OSS and provide solid packages for your needs. It’s a good sign for a free package.

Most importantly, those companies published their React-Native to the public, in production. They don’t consider it as a toy but as a full-blown technology that empowers their developers to move fast (and eventually break things).

In comparison, React-Native biggest opponent’s Flutter has yet to be used by big IT names.

Conclusion

Clearing things up : I’m not a React-Native fanboy. I’ll use whatever technology is best suited for my needs. And so far, React-Native has proven to be a valuable companion, and a friendly shoulder to lie on. It never stood in my way and always provided escape hatches, even in the most desperate situations.

But most importantly, there’s only so much reasons to keep developing in React-Native nowadays.

  • Its community is heavily invested
  • There’s a package for all you need
  • It’s reduces the learning curve to enter Mobile App Development
  • It empowers developers to iterate quicker than before
  • It allows you to reuse a huge part of your code and avoid duplicating business logic, constraints and rules

There’s never been such a good time to start React-Native development.
So, what are you waiting for ?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK