diff --git a/docs/pushnotificationios.html b/docs/pushnotificationios.html deleted file mode 100644 index 60258e5e378..00000000000 --- a/docs/pushnotificationios.html +++ /dev/null @@ -1,11 +0,0 @@ -Error: ReferenceError: notification is not defined - at /Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/guard.js:27:12 - at onOutputGenerated (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/index.js:96:9) - at Object.renderReactPage.done (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/DefaultRouter.js:352:7) - at renderReactPage (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/renderReactPage.js:130:17) - at renderComponentPackage (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/DefaultRouter.js:338:3) - at routePackageHandler (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/DefaultRouter.js:281:5) - at onComputePackage (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/index.js:100:9) - at /Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/guard.js:29:10 - at onWarmed (/Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/src/Packager.js:270:9) - at /Users/travis/build/facebook/react-native/website/node_modules/react-page-middleware/node_modules/async/lib/async.js:116:25 \ No newline at end of file diff --git a/docs/scrollview.html b/docs/scrollview.html deleted file mode 100644 index 5f9a6a0a4c4..00000000000 --- a/docs/scrollview.html +++ /dev/null @@ -1,152 +0,0 @@ -
Component that wraps platform ScrollView while providing -integration with touch locking "responder" system.
Doesn't yet support other contained responders from blocking this scroll -view from becoming the responder.
When true, the scroll view bounces horizontally when it reaches the end
-even if the content is smaller than the scroll view itself. The default
-value is true when horizontal={true} and false otherwise.
When true, the scroll view bounces vertically when it reaches the end
-even if the content is smaller than the scroll view itself. The default
-value is false when horizontal={true} and true otherwise.
When true, the scroll view bounces when it reaches the end of the
-content if the content is larger then the scroll view along the axis of
-the scroll direction. When false, it disables all bouncing even if
-the alwaysBounce* props are true. The default value is true.
When true, the scroll view automatically centers the content when the -content is smaller than the scroll view bounds; when the content is -larger than the scroll view, this property has no effect. The default -value is false.
These styles will be applied to the scroll view content container which -wraps all of the child views. Example:
return ( - <ScrollView contentContainerStyle={styles.contentContainer}> - </ScrollView> - ); - ... - var styles = StyleSheet.create({ - contentContainer: { - paddingVertical: 20 - } - });
A floating-point number that determines how quickly the scroll view -decelerates after the user lifts their finger. Reasonable choices include - - Normal: 0.998 (the default) - - Fast: 0.9
When true, the scroll view's children are arranged horizontally in a row -instead of vertically in a column. The default value is false.
Determines whether the keyboard gets dismissed in response to a drag. - - 'none' (the default), drags do not dismiss the keyboard. - - 'onDrag', the keyboard is dismissed when a drag begins. - - 'interactive', the keyboard is dismissed interactively with the drag - and moves in synchrony with the touch; dragging upwards cancels the - dismissal.
When false, tapping outside of the focused text input when the keyboard -is up dismisses the keyboard. When true, the scroll view will not catch -taps, and the keyboard will not dismiss automatically. The default value -is false.
The maximum allowed zoom scale. The default value is 1.0.
The minimum allowed zoom scale. The default value is 1.0.
When true, the scroll view stops on multiples of the scroll view's size -when scrolling. This can be used for horizontal pagination. The default -value is false.
Experimental: When true, offscreen child views (whose overflow value is
-hidden) are removed from their native backing superview when offscreen.
-This canimprove scrolling performance on long lists. The default value is
-false.
When true, the scroll view scrolls to top when the status bar is tapped. -The default value is true.
An array of child indices determining which children get docked to the
-top of the screen when scrolling. For example, passing
-stickyHeaderIndices={[0]} will cause the first child to be fixed to the
-top of the scroll view. This property is not supported in conjunction
-with horizontal={true}.
The current scale of the scroll view content. The default value is 1.0.
Initial maximum value of the slider. Default value is 1.
Initial minimum value of the slider. Default value is 0.
Callback called when the user finishes changing the value (e.g. when -the slider is released).
Callback continuously called while the user is dragging the slider.
Used to style and layout the Slider. See StyleSheet.js and
-ViewStylePropTypes.js for more info.
Initial value of the slider. The value should be between minimumValue -and maximumValue, which default to 0 and 1 respectively. -Default value is 0.
This is not a controlled component, e.g. if you don't update -the value, the component won't be reset to it's inital value.
All rights reserved.
This source code is licensed under the BSD-style license found in the -LICENSE file in the root directory of this source tree. An additional grant -of patent rights can be found in the PATENTS file in the same directory.
@flow
React Native doesn't implement CSS but instead relies on JavaScript to let you style your application. This has been a controversial decision and you can read through those slides for the rationale behind it.
- -The way to declare styles in React Native is the following:
StyleSheet.create construct is optional but provides some key advantages. It ensures that the values are immutable and opaque by transforming them into plain numbers that reference an internal table. By putting it at the end of the file, you also ensure that they are only created once for the application and not on every render.
All the attribute names and values are a subset of what works on the web. For layout, React Native implements Flexbox.
All the core components accept a style attribute
and also accepts an array of styles
The behavior is the same as Object.assign: in case of conflicting values, the one from the right-most element will have precedence and falsy values like false, undefined and null will be ignored. A common pattern is to conditionally add a style based on some condition.
Finally, if you really have to, you can also create style objects in render, but they are highly discouraged. Put them last in the array definition.
In order to let a call site customize the style of your component children, you can pass styles around. Use View.propTypes.style and Text.propTypes.style in order to make sure only styles are being passed.
You can checkout latest support of CSS Properties in following Links.
A StyleSheet is an abstraction similar to CSS StyleSheets
Create a new StyleSheet:
Use a StyleSheet:
Code quality:
Performance:
Use SwitchIOS to render a boolean input on iOS. This is
-a controlled component, so you must hook in to the onValueChange callback
-and update the value prop in order for the component to update, otherwise
-the user's change will be reverted immediately to reflect props.value as the
-source of truth.
If true the user won't be able to toggle the switch. -Default value is false.
Background color when the switch is turned on.
Callback that is called when the user toggles the switch.
Background color for the switch round button.
Background color when the switch is turned off.
The value of the switch, if true the switch will be turned on. -Default value is false.
The React Native repo has several tests you can run to verify you haven't caused a regression with your PR. These tests are run with the Travis continuous integration system, and will automatically post the results to your PR. You can also run them locally with cmd+U in the IntegrationTest and UIExplorer apps in Xcode. You can run the jest tests via npm test on the command line. We don't have great test coverage yet, however, so most changes will still require significant manual verification, but we would love it if you want to help us increase our test coverage!
Jest tests are JS-only tests run on the command line with node. The tests themselves live in the __tests__ directories of the files they test, and there is a large emphasis on aggressively mocking out functionality that is not under test for failure isolation and maximum speed. You can run the existing React Native jest tests with npm test from the react-native root, and we encourage you to add your own tests for any components you want to contribute to. See getImageSource-test.js for a basic example.
React Native provides facilities to make it easier to test integrated components that require both native and JS components to communicate across the bridge. The two main components are RCTTestRunner and RCTTestModule. RCTTestRunner sets up the ReactNative environment and provides facilities to run the tests as XCTestCases in Xcode (runTest:module is the simplest method). RCTTestModule is exported to JS via NativeModules as TestModule. The tests themselves are written in JS, and must call TestModule.markTestCompleted() when they are done, otherwise the test will timeout and fail. Test failures are primarily indicated by throwing an exception. It is also possible to test error conditions with runTest:module:initialProps:expectErrorRegex: or runTest:module:initialProps:expectErrorBlock: which will expect an error to be thrown and verify the error matches the provided criteria. See IntegrationTestHarnessTest.js and IntegrationTestsTests.m for example usage.
A common type of integration test is the snapshot test. These tests render a component, and verify snapshots of the screen against reference images using TestModule.verifySnapshot(), using the FBSnapshotTestCase library behind the scenes. Reference images are recorded by setting recordMode = YES on the RCTTestRunner, then running the tests. Snapshots will differ slightly between 32 and 64 bit, and various OS versions, so it's recommended that you enforce tests are run with the correct configuration. It's also highly recommended that all network data be mocked out, along with other potentially troublesome dependencies. See SimpleSnapshotTest for a basic example.
A react component for displaying text which supports nesting,
-styling, and touch handling. In the following example, the nested title and
-body text will inherit the fontFamily from styles.baseText, but the title
-provides its own additional styles. The title and body will stack on top of
-each other on account of the literal newlines:
Used to truncate the text with an elipsis after computing the text -layout, including line wrapping, such that the total number of lines does -not exceed this number.
This function is called on press. Text intrinsically supports press
-handling with a default highlight state (which can be disabled with
-suppressHighlighting).
When true, no visual change is made when text is pressed down. By -default, a gray oval highlights the text on press down.
Used to locate this view in end-to-end tests.
In iOS, the way to display formatted text is by using NSAttributedString: you give the text that you want to display and annotate ranges with some specific formatting. In practice, this is very tedious. For React Native, we decided to use web paradigm for this where you can nest text to achieve the same effect.
Behind the scenes, this is going to be converted to a flat NSAttributedString that contains the following information
The <Text> element is special relative to layout: everything inside is no longer using the flexbox layout but using text layout. This means that elements inside of a <Text> are no longer rectangles, but wrap when they see the end of the line.
On the web, the usual way to set a font family and size for the entire document is to write:
When the browser is trying to render a text node, it's going to go all the way up to the root element of the tree and find an element with a font-size attribute. An unexpected property of this system is that any node can have font-size attribute, including a <div>. This was designed for convenience, even though not really semantically correct.
In React Native, we are more strict about it: you must wrap all the text nodes inside of a <Text> component; you cannot have a text node directly under a <View>.
You also lose the ability to set up a default font for an entire subtree. The recommended way to use consistent fonts and sizes across your application is to create a component MyAppText that includes them and use this component across your app. You can also use this component to make more specific components like MyAppHeaderText for other kinds of text.
React Native still has the concept of style inheritance, but limited to text subtrees. In this case, the second part will be both bold and red.
We believe that this more constrained way to style text will yield better apps:
(Developer) React components are designed with strong isolation in mind: You should be able to drop a component anywhere in your application, trusting that as long as the props are the same, it will look and behave the same way. Text properties that could inherit from outside of the props would break this isolation.
(Implementor) The implementation of React Native is also simplified. We do not need to have a fontFamily field on every single element, and we do not need to potentially traverse the tree up to the root every time we display a text node. The style inheritance is only encoded inside of the native Text component and doesn't leak to other components or the system itself.
A foundational component for inputting text into the app via a -keyboard. Props provide configurability for several features, such as auto- -correction, auto-capitalization, placeholder text, and different keyboard -types, such as a numeric keypad.
The simplest use case is to plop down a TextInput and subscribe to the
-onChangeText events to read the user input. There are also other events, such
-as onSubmitEditing and onFocus that can be subscribed to. A simple
-example:
The value prop can be used to set the value of the input in order to make
-the state of the component clear, but <TextInput> does not behave as a true
-controlled component by default because all operations are asynchronous.
-Setting value once is like setting the default value, but you can change it
-continuously based on onChangeText events as well. If you really want to
-force the component to always revert to the value you are setting, you can
-set controlled={true}.
The multiline prop is not supported in all releases, and some props are
-multiline only.
Can tell TextInput to automatically capitalize certain characters.
If false, disables auto-correct. Default value is true.
If true, focuses the input on componentDidMount. Default value is false.
This helps avoid drops characters due to race conditions between JS and -the native text input. The default should be fine, but if you're -potentially doing very slow operations on every keystroke then you may -want to try increasing this.
When the clear button should appear on the right side of the text view
If you really want this to behave as a controlled component, you can set -this true, but you will probably see flickering, dropped keystrokes, -and/or laggy typing, depending on how you process onChange events.
If false, text is not editable. Default value is true.
If true, the keyboard disables the return key when there is no text and -automatically enables it when there is text. Default value is false.
Determines which keyboard to open, e.g.numeric.
If true, the text input can be multiple lines. Default value is false.
Callback that is called when the text input is blurred
(text: string) => void
Callback that is called when the text input's text changes.
Callback that is called when the text input is focused
If true, the TextInput will be a password field. Default value is false.
The string that will be rendered before text input has been entered
The text color of the placeholder string
Determines how the return key should look.
If true, the text input obscures the text entered so that sensitive text -like passwords stay secure. Default value is false.
See DocumentSelectionState.js, some state that is responsible for -maintaining selection information for a document
Used to locate this view in end-to-end tests.
The default value for the text input
Timers are an important part of an application and React Native implements the browser timers.
requestAnimationFrame(fn) is the exact equivalent of setTimeout(fn, 0), they are triggered right after the screen has been flushed.
setImmediate is executed at the end of the current JavaScript execution block, right before sending the batched response back to native. Note that if you call setImmediate within a setImmediate callback, it will be executed right away, it won't yield back to native in between.
The Promise implementation uses setImmediate as its asynchronicity primitive.
One reason why well-built native apps feel so smooth is by avoiding expensive operations during interactions and animations. In React Native, we currently have a limitation that there is only a single JS execution thread, but you can use InteractionManager to make sure long-running work is scheduled to start after any interactions/animations have completed.
Applications can schedule tasks to run after interactions with the following:
Compare this to other scheduling alternatives:
The touch handling system considers one or more active touches to be an 'interaction' and will delay runAfterInteractions() callbacks until all touches have ended or been cancelled.
InteractionManager also allows applications to register animations by creating an interaction 'handle' on animation start, and clearing it upon completion:
We found out that the primary cause of fatals in apps created with React Native was due to timers firing after a component was unmounted. To solve this recurring issue, we introduced TimerMixin. If you include TimerMixin, then you can replace your calls to setTimeout(fn, 500) with this.setTimeout(fn, 500) (just prepend this.) and everything will be properly cleaned up for you when the component unmounts.
We highly recommend never using bare timers and always using this mixin, it will save you from a lot of hard to track down bugs.
A wrapper for making views respond properly to touches. -On press down, the opacity of the wrapped view is decreased, which allows -the underlay color to show through, darkening or tinting the view. The -underlay comes from adding a view to the view hierarchy, which can sometimes -cause unwanted visual artifacts if not used correctly, for example if the -backgroundColor of the wrapped view isn't explicitly set to an opaque color.
Example:
Determines what the opacity of the wrapped view should be when touch is -active.
The color of the underlay that will show through when the touch is -active.
A wrapper for making views respond properly to touches. -On press down, the opacity of the wrapped view is decreased, dimming it. -This is done without actually changing the view hierarchy, and in general is -easy to add to an app without weird side-effects.
Example:
Determines what the opacity of the wrapped view should be when touch is -active.
Do not use unless you have a very good reason. All the elements that -respond to press should have a visual feedback when touched. This is -one of the primary reason a "web" app doesn't feel "native".
Enable iOS simulator's "Connect hardware keyboard" from menu Hardware > Keyboard menu.

If you are using a non-QWERTY/AZERTY keyboard layout you can use the Hardware > Shake Gesture to bring up the dev menu and click "Refresh"

Something is probably already running on port 8081. You can either kill it or try to change which port the packager is listening to.
$ sudo lsof -n -i4TCP:8081 | grep LISTEN
then
$ kill -9 <cma process id>
Edit AppDelegate.m to use a different port.
Permission settings prevent Wathcman to load. A recent update solves this, get a HEAD install of Watchman if you are experiening this error.
This tutorial aims to get you up to speed with writing iOS apps using React Native. If you're wondering what React Native is and why Facebook built it, this blog post explains that.
We assume you have experience writing websites with React. If not, you can learn about it on the React website.
React Native requires OSX, Xcode, Homebrew, node, npm, and watchman. Flow is optional.
After installing these dependencies there are two simple commands to get a React Native project all set up for development.
npm install -g react-native-cli
react-native-cli is a command line interface that does the rest of the set up. It’s installable via npm. This will install react-nativeas a command in your terminal. You only ever need to do this once.
react-native init AwesomeProject
This command fetches the React Native source code and dependencies and then creates a new Xcode project in AwesomeProject/AwesomeProject.xcodeproj.
You can now open this new project (AwesomeProject/AwesomeProject.xcodeproj) in Xcode and simply build and run it with cmd+R. Doing so will also start a node server which enables live code reloading. With this you can see your changes by pressing cmd+R in the simulator rather than recompiling in Xcode.
For this tutorial we'll be building a simple version of the Movies app that fetches 25 movies that are in theaters and displays them in a ListView.
react-native init will copy Examples/SampleProject to whatever you named your project, in this case AwesomeProject. This is a simple hello world app. You can edit index.ios.js to make changes to the app and then press cmd+R in the simulator to see the changes.
Before we write the code to fetch actual Rotten Tomatoes data let's mock some data so we can get our hands dirty with React Native. At Facebook we typically declare constants at the top of JS files, just below the requires, but feel free to add the following constant wherever you like. In index.ios.js:
We're going to render the title, year, and thumbnail for the movie. Since thumbnail is an Image component in React Native, add Image to the list of React requires below.
Now change the render function so that we're rendering the data mentioned above rather than hello world.
Press cmd+R and you should see "Title" above "2015". Notice that the Image doesn't render anything. This is because we haven't specified the width and height of the image we want to render. This is done via styles. While we're changing the styles let's also clean up the styles we're no longer using.
And lastly we need to apply this style to the Image component:
Press cmd+R and the image should now render.
-Great, we've rendered our data. Now let's make it look better. I'd like to put the text to the right of the image and make the title larger and centered within that area:
We'll need to add another container in order to vertically lay out components within horizontally layed out components.
Not too much has changed, we added a container around the Texts and then moved them after the Image (because they're to the right of the Image). Let's see what the style changes look like:
We use FlexBox for layout - see this great guide to learn more about it.
In the above code snippet, we simply added flexDirection: 'row' that will make children of our main container to be layed out horizontally instead of vertically.
Now add another style to the JS style object:
This means that the rightContainer takes up the remaining space in the parent container that isn't taken up by the Image. If this doesn't make sense, add a backgroundColor to rightContainer and then try removing the flex: 1. You'll see that this causes the container's size to be the minimum size that fits its children.
Styling the text is pretty straightforward:
Go ahead and press cmd+R and you'll see the updated view.
-Fetching data from Rotten Tomatoes's API isn't really relevant to learning React Native so feel free to breeze through this section.
Add the following constants to the top of the file (typically below the requires) to create the REQUEST_URL used to request data with.
Add some initial state to our application so that we can check this.state.movies === null to determine whether the movies data has been loaded or not. We can set this data when the response comes back with this.setState({movies: moviesData}). Add this code just above the render function inside our React class.
We want to send off the request after the component has finished loading. componentDidMount is a function of React components that React will call exactly once, just after the component has been loaded.
Now add fetchData function used above to our main component. This method will be responsible for handling data fetching. All you need to do is call this.setState({movies: data}) after resolving the promise chain because the way React works is that setState actually triggers a re-render and then the render function will notice that this.state.movies is no longer null. Note that we call done() at the end of the promise chain - always make sure to call done() or any errors thrown will get swallowed.
Now modify the render function to render a loading view if we don't have any movies data, and to render the first movie otherwise.
Now press cmd+R and you should see "Loading movies..." until the response comes back, then it will render the first movie it fetched from Rotten Tomatoes.
-Let's now modify this application to render all of this data in a ListView component, rather than just rendering the first movie.
Why is a ListView better than just rendering all of these elements or putting them in a ScrollView? Despite React being fast, rendering a possibly infinite list of elements could be slow. ListView schedules rendering of views so that you only display the ones on screen and those already rendered but off screen are removed from the native view hierarchy.
First thing's first: add the ListView require to the top of the file.
Now modify the render function so that once we have our data it renders a ListView of movies instead of a single movie.
The DataSource is an interface that ListView is using to determine which rows have changed over the course of updates.
You'll notice we used dataSource from this.state. The next step is to add an empty dataSource to the object returned by getInitialState. Also, now that we're storing the data in dataSource, we should no longer use this.state.movies to avoid storing data twice. We can use boolean property of the state (this.state.loaded) to tell whether data fetching has finished.
And here is the modified fetchData method that updates the state accordingly:
Finally, we add styles for the ListView component to the styles JS object:
And here's the final result:
-There's still some work to be done to make it a fully functional app such as: adding navigation, search, infinite scroll loading, etc. Check the Movies Example to see it all working.
The Vibration API is exposed at VibrationIOS.vibrate(). On iOS, calling this
-function will trigger a one second vibration. The vibration is asynchronous
-so this method will return immediately.
There will be no effect on devices that do not support Vibration, eg. the iOS -simulator.
Vibration patterns are currently unsupported.
With Christopher "vjeux" Chedeau and Spencer Ahrens
- -With Christopher "vjeux" Chedeau and Jordan Walke
-The most fundamental component for building UI, View is a
-container that supports layout with flexbox, style, some touch handling, and
-accessibility controls, and is designed to be nested inside other views and
-to have 0 to many children of any type. View maps directly to the native
-view equivalent on whatever platform react is running on, whether that is a
-UIView, <div>, android.view, etc. This example creates a View that
-wraps two colored boxes and custom component in a row with padding.
Views are designed to be used with StyleSheets for clarity and
-performance, although inline styles are also supported.
Overrides the text that's read by the screen reader when the user interacts -with the element. By default, the label is constructed by traversing all the -children and accumulating all the Text nodes separated by space.
When true, indicates that the view is an accessibility element. By default, -all the touchable elements are accessible.
For most touch interactions, you'll simply want to wrap your component in
-TouchableHighlight or TouchableOpacity. Check out Touchable.js,
-ScrollResponder.js and ResponderEventPlugin.js for more discussion.
In the absence of auto property, none is much like CSS's none
-value. box-none is as if you had applied the CSS class:
box-only is the equivalent of
But since pointerEvents does not affect layout/appearance, and we are
-already deviating from the spec by adding additional modes, we opt to not
-include pointerEvents on style. On some platforms, we would need to
-implement it as a className anyways. Using style or not is an
-implementation detail of the platform.
This is a special performance property exposed by RCTView and is useful -for scrolling content when there are many subviews, most of which are -offscreen. For this property to be effective, it must be applied to a -view that contains many subviews that extend outside its bound. The -subviews must also have overflow: hidden, as should the containing view -(or one of its superviews).
Used to locate this view in end-to-end tests.
React Native enables you to build world-class application experiences on native platforms using a consistent developer experience based on JavaScript and React. The focus of React Native is on developer efficiency across all the platforms you care about — learn once, write anywhere. Facebook uses React Native in multiple production apps and will continue investing in React Native.
With React Native, you can use the standard platform components such as UITabBar and UINavigationController on iOS. This gives your app a consistent look and feel with the rest of the platform ecosystem, and keeps the quality bar high. These components are easily incorporated into your app using their React component counterparts, such as TabBarIOS and NavigatorIOS.
All operations between the JavaScript application code and the native platform are performed asynchronously, and the native modules can also make use of additional threads as well. This means we can decode images off of the main thread, save to disk in the background, measure text and compute layouts without blocking the UI, and more. As a result, React Native apps are naturally fluid and responsive. The communication is also fully serializable, which allows us to leverage Chrome Developer Tools to debug the JavaScript while running the complete app, either in the simulator or on a physical device.
See Debugging.

iOS has a very powerful system called the Responder Chain to negotiate touches in complex view hierarchies which does not have a universal analog on the web. React Native implements a similar responder system and provides high level components such as TouchableHighlight that integrate properly with scroll views and other elements without any additional configuration.
Laying out views should be easy, which is why we brought the flexbox layout model from the web to React Native. Flexbox makes it simple to build the most common UI layouts, such as stacked and nested boxes with margin and padding. React Native also supports common web syles, such as fontWeight, and the StyleSheet abstraction provides an optimized mechanism to declare all your styles and layout right along with the components that use them and apply them inline.
React Native is focused on changing the way view code is written. For the rest, we look to the web for universal standards and polyfill those APIs where appropriate. You can use npm to install JavaScript libraries that work on top of the functionality baked into React Native, such as XMLHttpRequest, window.requestAnimationFrame, and navigator.geolocation. We are working on expanding the available APIs, and are excited for the Open Source community to contribute as well.
It is certainly possible to create a great app using React Native without writing a single line of native code, but React Native is also designed to be easily extended with custom native views and modules - that means you can reuse anything you've already built, and can import and use your favorite native libraries. To create a simple module in iOS, create a new class that implements the RCTBridgeModule protocol, and add RCT_EXPORT to the function you want to make available in JavaScript.
Custom iOS views can be exposed by subclassing RCTViewManager, implementing a -(UIView *)view method, and exporting properties with the RCT_EXPORT_VIEW_PROPERTY macro. Then a simple JavaScript file connects the dots.