Ilja
Ilja

Reputation: 46479

React native usage with development / production ios target apps

I've been reading about how to separate your development builds from production i.e. use different environments / databases etc. where this post proved to be very useful: http://www.appcoda.com/using-xcode-targets

But I am struggling with figuring out how to take advantage of this when building react native apps. i.e. what are the steps that need to be taken in xCode and javascript source? Do we get access to some sort of global that can be checked what target is running etc..

I wasn't able to find good article on this for react native so if you have experience with setting these different environments or can link to a good source, please let me know.

Upvotes: 2

Views: 1607

Answers (1)

Varsha
Varsha

Reputation: 966

There are numerous ways to organize a project and you can spend a lot of time reading about them and debating the pros and cons of each none will be perfect.

There are a few primary goals while organizing a React Native project.

Cross Platform — One of the best part about React Native and writing our native app in Javascript is that we can write for both Android and iOS (with more platforms coming in the future).

Maximum Code Reuse — Much like being able to write code for both platforms, So able to reuse as much code as possible between the two platforms. Even if the UI components look different between platforms the business logic behind them should be same and reused.

Keep Configuration out of the Code — Settings, colors, image paths, routes, etc. are all pieces of code that are used in multiple places throughout the app and can change. Therefore, these items should live in one easily accessible place.

Minimize Component State — To use stateless functional components, components that are a function of their props, as much as possible keep things simple.

These are few helpful sources -

Blog : setting up react-native build environments using native modules

Setup multiple schemes & configurations in Xcode for your React Native iOS app

Beginning Mobile App Development with React Native

8 Awesome React-Native Starter Kits

Organizing a React Native Project

Upvotes: 3

Related Questions