Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using React Native within existing iOS app for some views only

Tags:

react-native

Is it possible to use React Native only for one view within the project?

I've successfully added React view for particular iOS app screen (using instructions from "Integration with existing iOS project" docs), but i don't know how to get data from that screen and call other (objective-c) code. For example I want to replace old storyboard-based Search Form to React view and then call storyboard-based screens when user clicks "Search".

Or it is intended to make all views in React and convert existing non-React views into 'native' components (very huge work for big apps)?

like image 508
aksonov Avatar asked Sep 28 '22 16:09

aksonov


1 Answers

This is easily accomplished via the Native Module concept which is described here - https://facebook.github.io/react-native/docs/nativemodulesios.html

You can export obj-c methods to JS via a single call.

like image 52
Sean Kinsey Avatar answered Oct 03 '22 03:10

Sean Kinsey