loading...

My Experience with Native Script and why I've Switched to React Native

ethantoney profile image Ethan Toney ・2 min read

Note: I'm a web dev that started in on mobile dev due to a few ideas I had. I am not an experienced mobile dev.

When I first started mobile development, I narrowed my choices to two: React Native and NativeScript.

NativeScript has a few features I like about it. First, you can choose Angular, Vue.js (supports Typescript), or vanilla JS.

NativeScript runs natively (mostly). And the team there suggest that NS may have certain features that would fare better over RN. That being said, NS wasn't a fun experience. NS requires two apps, one to connect to your project, the other to open your project. The live reloading didn't always work, and compiling became an issue for small things. While my experience was certainly a factor, the documentation didn't always cover my needs. Portions of the docs were old and outdated. Other portions vaguely covered topics.

So I tried out React Native. There's a great course at http://www.handlebarlabs.com/ that was recently updated. While I didn't start with that course, I ended up using the course to expand my knowledge on professionalism (standard folder structure, etc.) in RN.

RN isn't always easy to use, but the hot reload feature works better for me than the NS apps. Since RN uses Javascript (also supports Typescript), RN is much more familiar to me than NS.

The only downside I've had so far with RN is the debugger. The debugger is not always clear with errors.

Possibly my favorite part of React Native is navigation. It's fairly simple to setup and create a basic app with navigation. I only use React Navigation, but there are a few other choices out there. (That being said, I couldn't figure out navigating in NS. It would continually break on me, even with the templates.)

That being said, whatever framework or library you use, I'm hoping you enjoy it!

Want to correct me? Want to add something else? Feel free to drop a comment.

Discussion

pic
Editor guide
Collapse
stereoplegic profile image
Mike Bybee

I worked with NativeScript for a while (after a few years of Cordova, which had awesome cross-platform support, but webview performance on mobile was just too poor for anything beyond the simplest of apps). I loved that I could use vanilla JS, but I ran into the same issues as web (reinventing too many wheels) plus - as you mentioned - a subpar tooling experience.

After finally giving React a fair shake on web and growing to prefer it over Vue (and Riot, and HyperHTML, and several other more lightweight UI libs which still led to reinventing wheels), I decided that it made sense to give RN a shot as well.

It wasn't always easy back then (~4 years ago, a lot has changed), but it felt like a breeze compared to NS almost right away (granted, armed with just over a year of React experience by then).

While I'm always eyeing the horizon, I haven't felt the need to drop RN, and in fact went all in by building web apps with React Native Web, and desktop apps with RNW and Electron (note I'm always eyeing alternatives to Electron too, but they usually don't stick around long enough to match stability or features), all from the same codebase (at least 90% of it shared on all projects now).

I pay attention to advances to Flutter when it comes to cross platform support as well, but I just can't justify a prolonged job search for Dart devs when it's so easy to ramp up JS devs to RN.

Collapse
ethantoney profile image
Ethan Toney Author

Being able to write vanilla JS was one of the reason I first picked NativeScript.

I actually went the reverse. I started out with React Native and ended up using React on my web projects. I also considered Flutter for a while, but with the user base and support for React/RN, along with the strong documentation, it was hard to look elsewhere. (Though Flutter has great documentation, the app size is heavier than RN and the user base isn't as large as React/RN.)

Thanks for the comment, glad to know my experience with NS is shared by others who have dealt with the same or similar problems.