Is it possible to use React Native CLI for cross platform development?

140 views Asked by At

I wanted to learn how to develop apps using React Native. I watched a few video guides, and in every single video, people develop the app in Visual Studio Code, and promise me "cross-platformness". On the front page of the React Native website, they also say that react native is used to write cross-platform code. Yet when I go to the "Get Started page" and choose React Native CLI (because I heard it's the standard way to develop apps, and more functional), it asks me to choose my target platform, as if I need to create two different projects for my app, and then makes me install Android Studio and Xcode, even though everyone else tells me to use VS code. So, here I am, trying to use VS code and React Native CLI to develop cross-platform applications just like in video guides, and on the front page of React Native's website, and not understanding why Get started page tells me to install Android Studio and Xcode, and choose my target platform. Can anyone explain to me what is the truth?

I tried finding articles on stack overflow, and searching the web, and even asking ChatGPT, but I found no good answer, that did not confuse me even more.

1

There are 1 answers

6
Michael Bahl On

If you wanna start with react native you can start with expo which will makes many things easier (playground, docs). You won't need xcode nore android studio using expo.

If you wanna use bare react native you have to install xcode and android studio for to build a react native app. The bare workflow will allow you to utilize native modules, that means you can bridge to native iOS/android libraries via objective-c and or java. That way you can implement functions which were not provided by react native.

Honestly the far most projects won't need any native bridging, you probably won't need any functions which were not provided by react-native/expo. Many common native functions were provided by react native like GPS, Sound, Push Notifications ...