😱 Introduction to React Native
When it comes to developing mobile apps most people might think about Xcode with objective C for iOS, and Eclipse and Java for android. And a lot of time is being spend doing the same thing just in two different languages, which is really a waste of time. This is where React Native comes into play.
There are a lot of tutorials online to teach you how to do this. Basically you only need to:
* install Xcode * install npm * install react-native * `react-native init SampleProjectHelloWorld`
And that’s all. You would have a project with entry
index.ios.js and project name
The entry point for the project is
index.ios.js. And in the
render() method is the React component that you want your users to see.
There are some basic React Native components that I use frequently.
- Image - it’s just like a in a webpage
- ListView - it displays a list
- Navigator - this gives you transition between scenes in your app.
- ScrollView - so that you can scroll your viewport
- View - you can specify the height, width, color and it’s in a way like a
- TouchableOpacity - this helps you handle
Useful 3rd party modules
react-native-maps for example. Basically you simply
npm install react-native-maps into your project. Then you can do
import MapView from 'react-native-maps';
To use this
MapView component to render a map.
In many situations you also need to import libraries into your project. You need to link the libraries before you can use this module in the project. You can either install
rnpm and do
rnpm link to link the libraries, or you can link the libraries through Xcode by yourself.
Integrate existing objective C modules into your react native app.
I’ll have a more detailed post on this.
- How To Easily Make Your Objective-C Code Work With React Native
30 Jul 2016