Lots of people are talking about React Native. You can code in JavaScript and then it compiles to native Android and iOS. Sounds pretty awesome, and if you read the React Native Getting Started Guide, it’ll seem like React Native was sent down from the Open Source Heavens to solve all of the problems we have with normal native app development.

Unfortunately, as soon as you start to implement it, you run into issues.

Just Install Node (and NPM) with HomeBrew, then run these two commands

You do that, and your app does not compile. Why? Because you have the latest version of Node, obviously. You’re supposed to have the 2016 version of Node. React Native’s Getting Started Guide only works with that for now. But there’s a second, different, almost unrelated Getting Started Guide on the same page. There’s a literal tab for switching between two different guides.

The one on the left is a decoy meant to make you feel stupid, and mentally prepare you for the dependancy hell you are about to experience.

And to help you feel even better, React Native serves up this nice reminder:

No I haven’t, and now I feel stupid. Thanks, Zuckerburg.

 

But so you waste hours on that. You uninstall and reinstall Node and NPM and read joke-articles about dependency hell. You’re not a web developer so a lot of this is a bit confusing to you. Finally, you get it working and you follow the guide. Everything seems simple. Things start to work

“This is so easy! I now see why people like React Native!” you say, elated and curious. You look forward to making an app. First thing you do is you try to set a background image on your welcome screen. How do I do that? Stack Overflow makes it seem simple.

Seems simple, right?

 

WRONG. You’re supposed to use ABOSLUTE POSITIONING, which sounds just dirty.

Nope. Nothing is that simple.< Image/> was rewritten to no longer take children, and not a single StackOverflow answer has been updated to reflect this. Why? My guess is that all of the people who answered, gave up on React Native. In fact, almost every user in the StackOverflow thread I linked above didn’t answer a single React Native question after that one. They stuck to Native iOS or Android, or just never answered another StackOverflow question after that. I suspect React Native made them give up programming forever.

So anyway, you do some googling and you finally figure out that you’re supposed to use <ImageBackground/> instead. It’s like <Image/>, except it can have children, like <Image/> used to be able to do. Sound great. Where is the documentation for this? Right Here. You can go ahead and click that link.

Since you probably didn’t click the link, here’s a preview. This is also what a typical link to any React Native documentation usually looks like.

So, you replace the image with a <ImageBackground/> and see what happens.

And it works! Huzzah! You just spent more than an hour trying to set a background image on your splash screen. But surely not everything will be that difficult? I mean, React Native has been around for a long time.

Your next part sounds easy enough. You have a SQLite database, and you need React Native to access the database. There’s a library everyone recommends and it seems to work for them. Sounds like it could work. You probably won’t spend an entire week just to get your app to access a database, any database, somehow. I mean… you’re a developer and this shouldn’t be THAT hard, right?

 

 

 

 

 

 

 

 

 

 

 

 

Disclaimer: React Native seems pretty nice, but it’s really unfinished right now. If you love seeing Stack Overflow answers say “there is no accepted method or library to do this thing, but feel free to build your own! :D” Then you’ll probably love React Native.

Categories: Development General

Leave a Reply