diff --git a/blog/2016/08/19/right-to-left-support-for-react-native-apps.html b/blog/2016/08/19/right-to-left-support-for-react-native-apps.html index 4de0e0e11b4..14a4b46b5c3 100644 --- a/blog/2016/08/19/right-to-left-support-for-react-native-apps.html +++ b/blog/2016/08/19/right-to-left-support-for-react-native-apps.html @@ -169,7 +169,7 @@ _onDirectionChange = ()'Reload this page', 'Please reload this page to change the UI direction! ' + 'All examples in this app will be affected. ' + - 'Check them out to see what they look like in RTL layout.' + 'Check them out to see what they look like in RTL layout.', ); }; diff --git a/blog/2016/08/19/right-to-left-support-for-react-native-apps/index.html b/blog/2016/08/19/right-to-left-support-for-react-native-apps/index.html index 4de0e0e11b4..14a4b46b5c3 100644 --- a/blog/2016/08/19/right-to-left-support-for-react-native-apps/index.html +++ b/blog/2016/08/19/right-to-left-support-for-react-native-apps/index.html @@ -169,7 +169,7 @@ _onDirectionChange = ()'Reload this page', 'Please reload this page to change the UI direction! ' + 'All examples in this app will be affected. ' + - 'Check them out to see what they look like in RTL layout.' + 'Check them out to see what they look like in RTL layout.', ); }; diff --git a/blog/page3/index.html b/blog/page3/index.html index 765bb5f778a..3b81e177bc2 100644 --- a/blog/page3/index.html +++ b/blog/page3/index.html @@ -447,7 +447,7 @@ _onDirectionChange = ()'Reload this page', 'Please reload this page to change the UI direction! ' + 'All examples in this app will be affected. ' + - 'Check them out to see what they look like in RTL layout.' + 'Check them out to see what they look like in RTL layout.', ); }; diff --git a/docs/0.10/accessibility.html b/docs/0.10/accessibility.html index a28eee92ed3..08f218a5456 100644 --- a/docs/0.10/accessibility.html +++ b/docs/0.10/accessibility.html @@ -95,7 +95,7 @@
  • header Used when an element acts as a header for a content section (e.g. the title of a navigation bar).
  • summary Used when an element can be used to provide a quick summary of current conditions in the app when the app first launches.
  • -

    accessibilityState (iOS, Android)

    +

    accessibilityStates (iOS, Android)

    Note: > accessibilityRole and accessibilityStates are meant to be a cross-platform solution to replace accessibilityTraits and accessibilityComponentType, which will soon be deprecated. When possible, use accessibilityRole and accessibilityStates instead of accessibilityTraits and accessibilityComponentType.

    @@ -104,7 +104,7 @@
  • selected Used when the element is in a selected state. For example, a button is selected.
  • disabled Used when the element is disabled and cannot be interacted with.
  • -

    To use, set the accessibilityState to an array containing either selected, disabled, or both.

    +

    To use, set the accessibilityStates to an array containing either selected, disabled, or both.

    accessibilityTraits (iOS)

    Note: accessibilityTraits will soon be deprecated. When possible, use accessibilityRole and accessibilityStates instead of accessibilityTraits and accessibilityComponentType.

    diff --git a/docs/0.10/accessibility/index.html b/docs/0.10/accessibility/index.html index a28eee92ed3..08f218a5456 100644 --- a/docs/0.10/accessibility/index.html +++ b/docs/0.10/accessibility/index.html @@ -95,7 +95,7 @@
  • header Used when an element acts as a header for a content section (e.g. the title of a navigation bar).
  • summary Used when an element can be used to provide a quick summary of current conditions in the app when the app first launches.
  • -

    accessibilityState (iOS, Android)

    +

    accessibilityStates (iOS, Android)

    Note: > accessibilityRole and accessibilityStates are meant to be a cross-platform solution to replace accessibilityTraits and accessibilityComponentType, which will soon be deprecated. When possible, use accessibilityRole and accessibilityStates instead of accessibilityTraits and accessibilityComponentType.

    @@ -104,7 +104,7 @@
  • selected Used when the element is in a selected state. For example, a button is selected.
  • disabled Used when the element is disabled and cannot be interacted with.
  • -

    To use, set the accessibilityState to an array containing either selected, disabled, or both.

    +

    To use, set the accessibilityStates to an array containing either selected, disabled, or both.

    accessibilityTraits (iOS)

    Note: accessibilityTraits will soon be deprecated. When possible, use accessibilityRole and accessibilityStates instead of accessibilityTraits and accessibilityComponentType.

    diff --git a/docs/0.10/accessibilityinfo.html b/docs/0.10/accessibilityinfo.html index 1c1cc1a3d05..2588919da7c 100644 --- a/docs/0.10/accessibilityinfo.html +++ b/docs/0.10/accessibilityinfo.html @@ -16,7 +16,7 @@ componentDidMount() { AccessibilityInfo.addEventListener( 'change', - this._handleScreenReaderToggled + this._handleScreenReaderToggled, ); AccessibilityInfo.fetch().done((isEnabled) => { this.setState({ @@ -28,7 +28,7 @@ componentWillUnmount() { AccessibilityInfo.removeEventListener( 'change', - this._handleScreenReaderToggled + this._handleScreenReaderToggled, ); } diff --git a/docs/0.10/accessibilityinfo/index.html b/docs/0.10/accessibilityinfo/index.html index 1c1cc1a3d05..2588919da7c 100644 --- a/docs/0.10/accessibilityinfo/index.html +++ b/docs/0.10/accessibilityinfo/index.html @@ -16,7 +16,7 @@ componentDidMount() { AccessibilityInfo.addEventListener( 'change', - this._handleScreenReaderToggled + this._handleScreenReaderToggled, ); AccessibilityInfo.fetch().done((isEnabled) => { this.setState({ @@ -28,7 +28,7 @@ componentWillUnmount() { AccessibilityInfo.removeEventListener( 'change', - this._handleScreenReaderToggled + this._handleScreenReaderToggled, ); } diff --git a/docs/0.10/alertios.html b/docs/0.10/alertios.html index bb9b824a162..3659c20e15f 100644 --- a/docs/0.10/alertios.html +++ b/docs/0.10/alertios.html @@ -35,7 +35,7 @@ text: 'Install', onPress: () => console.log('Install Pressed'), }, - ] + ], );

    Example with custom buttons:

    @@ -53,7 +53,7 @@ onPress: (password) => console.log('OK Pressed, password: ' + password), }, ], - 'secure-text' + 'secure-text', );

    Example with the default button and a custom callback:

    @@ -62,7 +62,7 @@ null, (text) => console.log('Your username is ' + text), null, - 'default' + 'default', );

    Methods

    @@ -103,7 +103,7 @@ [callbackOrButtons], [type], [defaultValue], - [keyboardType] + [keyboardType], );

    Create and display a prompt to enter some text.

    diff --git a/docs/0.10/alertios/index.html b/docs/0.10/alertios/index.html index bb9b824a162..3659c20e15f 100644 --- a/docs/0.10/alertios/index.html +++ b/docs/0.10/alertios/index.html @@ -35,7 +35,7 @@ text: 'Install', onPress: () => console.log('Install Pressed'), }, - ] + ], );

    Example with custom buttons:

    @@ -53,7 +53,7 @@ onPress: (password) => console.log('OK Pressed, password: ' + password), }, ], - 'secure-text' + 'secure-text', );

    Example with the default button and a custom callback:

    @@ -62,7 +62,7 @@ null, (text) => console.log('Your username is ' + text), null, - 'default' + 'default', );

    Methods

    @@ -103,7 +103,7 @@ [callbackOrButtons], [type], [defaultValue], - [keyboardType] + [keyboardType], );

    Create and display a prompt to enter some text.

    diff --git a/docs/0.10/animated.html b/docs/0.10/animated.html index 92f3bb6a992..958e4130e4c 100644 --- a/docs/0.10/animated.html +++ b/docs/0.10/animated.html @@ -13,7 +13,7 @@ this.state.fadeAnim, // The value to drive { toValue: 1, // Animate to final value of 1 - } + }, ).start(); // Start the animation

    Refer to the Animations guide to see additional examples of Animated in action.

    diff --git a/docs/0.10/animated/index.html b/docs/0.10/animated/index.html index 92f3bb6a992..958e4130e4c 100644 --- a/docs/0.10/animated/index.html +++ b/docs/0.10/animated/index.html @@ -13,7 +13,7 @@ this.state.fadeAnim, // The value to drive { toValue: 1, // Animate to final value of 1 - } + }, ).start(); // Start the animation

    Refer to the Animations guide to see additional examples of Animated in action.

    diff --git a/docs/0.10/animatedvaluexy.html b/docs/0.10/animatedvaluexy.html index bee5b9b7926..46b3693f9ec 100644 --- a/docs/0.10/animatedvaluexy.html +++ b/docs/0.10/animatedvaluexy.html @@ -27,7 +27,7 @@ onPanResponderRelease: () => { Animated.spring( this.state.pan, // Auto-multiplexed - {toValue: {x: 0, y: 0}} // Back to zero + {toValue: {x: 0, y: 0}}, // Back to zero ).start(); }, }); diff --git a/docs/0.10/animatedvaluexy/index.html b/docs/0.10/animatedvaluexy/index.html index bee5b9b7926..46b3693f9ec 100644 --- a/docs/0.10/animatedvaluexy/index.html +++ b/docs/0.10/animatedvaluexy/index.html @@ -27,7 +27,7 @@ onPanResponderRelease: () => { Animated.spring( this.state.pan, // Auto-multiplexed - {toValue: {x: 0, y: 0}} // Back to zero + {toValue: {x: 0, y: 0}}, // Back to zero ).start(); }, }); diff --git a/docs/0.10/animations.html b/docs/0.10/animations.html index 350584c2385..b7cfc66de86 100644 --- a/docs/0.10/animations.html +++ b/docs/0.10/animations.html @@ -169,7 +169,7 @@ Animated.spring(a, { }], }} -

    interpolate() supports multiple range segments as well, which is handy for defining dead zones and other handy tricks. For example, to get an negation relationship at -300 that goes to 0 at -100, then back up to 1 at 0, and then back down to zero at 100 followed by a dead-zone that remains at 0 for everything beyond that, you could do:

    +

    interpolate() supports multiple range segments as well, which is handy for defining dead zones and other handy tricks. For example, to get a negation relationship at -300 that goes to 0 at -100, then back up to 1 at 0, and then back down to zero at 100 followed by a dead-zone that remains at 0 for everything beyond that, you could do:

    value.interpolate({
       inputRange: [-300, -100, 0, 100, 101],
       outputRange: [300, 0, 1, 0, 0],
    @@ -256,7 +256,7 @@ Animated.timing(opacity, {
             },
           },
         ],
    -    {useNativeDriver: true} // <-- Add this
    +    {useNativeDriver: true}, // <-- Add this
       )}>
       {content}
     </Animated.ScrollView>
    diff --git a/docs/0.10/animations/index.html b/docs/0.10/animations/index.html
    index 350584c2385..b7cfc66de86 100644
    --- a/docs/0.10/animations/index.html
    +++ b/docs/0.10/animations/index.html
    @@ -169,7 +169,7 @@ Animated.spring(a, {
         }],
       }}
     
    -

    interpolate() supports multiple range segments as well, which is handy for defining dead zones and other handy tricks. For example, to get an negation relationship at -300 that goes to 0 at -100, then back up to 1 at 0, and then back down to zero at 100 followed by a dead-zone that remains at 0 for everything beyond that, you could do:

    +

    interpolate() supports multiple range segments as well, which is handy for defining dead zones and other handy tricks. For example, to get a negation relationship at -300 that goes to 0 at -100, then back up to 1 at 0, and then back down to zero at 100 followed by a dead-zone that remains at 0 for everything beyond that, you could do:

    value.interpolate({
       inputRange: [-300, -100, 0, 100, 101],
       outputRange: [300, 0, 1, 0, 0],
    @@ -256,7 +256,7 @@ Animated.timing(opacity, {
             },
           },
         ],
    -    {useNativeDriver: true} // <-- Add this
    +    {useNativeDriver: true}, // <-- Add this
       )}>
       {content}
     </Animated.ScrollView>
    diff --git a/docs/0.10/building-from-source.html b/docs/0.10/building-from-source.html
    index 3e958a7fec7..410e0a91b8d 100644
    --- a/docs/0.10/building-from-source.html
    +++ b/docs/0.10/building-from-source.html
    @@ -59,7 +59,7 @@
     

    Step 2: Create a local.properties file in the android directory of your react-native app with the following contents:

    Example:

    sdk.dir=/Users/your_unix_name/android-sdk-macosx
    -ndk.dir=/Users/your_unix_name/android-ndk/android-ndk-r10e
    +ndk.dir=/Users/your_unix_name/android-ndk/android-ndk-r17b
     

    Download links for Android NDK

      @@ -96,13 +96,13 @@ ndk.dir=/Users/your_unix_name/android-ndk/an rootProject.projectDir, '../node_modules/react-native/ReactAndroid') ...
    -

    Modify your android/app/build.gradle to use the :ReactAndroid project instead of the pre-compiled library, e.g. - replace compile 'com.facebook.react:react-native:+' with compile project(':ReactAndroid'):

    +

    Modify your android/app/build.gradle to use the :ReactAndroid project instead of the pre-compiled library, e.g. - replace implementation 'com.facebook.react:react-native:+' with implementation project(':ReactAndroid'):

    ...
     dependencies {
    -    compile fileTree(dir: 'libs', include: ['*.jar'])
    -    compile 'com.android.support:appcompat-v7:26.0.2'
    +    implementation fileTree(dir: 'libs', include: ['*.jar'])
    +    implementation 'com.android.support:appcompat-v7:26.0.2'
     
    -    compile project(':ReactAndroid')
    +    implementation project(':ReactAndroid')
     
         ...
     }
    diff --git a/docs/0.10/building-from-source/index.html b/docs/0.10/building-from-source/index.html
    index 3e958a7fec7..410e0a91b8d 100644
    --- a/docs/0.10/building-from-source/index.html
    +++ b/docs/0.10/building-from-source/index.html
    @@ -59,7 +59,7 @@
     

    Step 2: Create a local.properties file in the android directory of your react-native app with the following contents:

    Example:

    sdk.dir=/Users/your_unix_name/android-sdk-macosx
    -ndk.dir=/Users/your_unix_name/android-ndk/android-ndk-r10e
    +ndk.dir=/Users/your_unix_name/android-ndk/android-ndk-r17b
     

    Download links for Android NDK

      @@ -96,13 +96,13 @@ ndk.dir=/Users/your_unix_name/android-ndk/an rootProject.projectDir, '../node_modules/react-native/ReactAndroid') ...
    -

    Modify your android/app/build.gradle to use the :ReactAndroid project instead of the pre-compiled library, e.g. - replace compile 'com.facebook.react:react-native:+' with compile project(':ReactAndroid'):

    +

    Modify your android/app/build.gradle to use the :ReactAndroid project instead of the pre-compiled library, e.g. - replace implementation 'com.facebook.react:react-native:+' with implementation project(':ReactAndroid'):

    ...
     dependencies {
    -    compile fileTree(dir: 'libs', include: ['*.jar'])
    -    compile 'com.android.support:appcompat-v7:26.0.2'
    +    implementation fileTree(dir: 'libs', include: ['*.jar'])
    +    implementation 'com.android.support:appcompat-v7:26.0.2'
     
    -    compile project(':ReactAndroid')
    +    implementation project(':ReactAndroid')
     
         ...
     }
    diff --git a/docs/0.10/custom-webview-android.html b/docs/0.10/custom-webview-android.html
    index 50aed98aa13..e0f0aeb015b 100644
    --- a/docs/0.10/custom-webview-android.html
    +++ b/docs/0.10/custom-webview-android.html
    @@ -174,7 +174,7 @@
     const RCTCustomWebView = requireNativeComponent(
       'RCTCustomWebView',
       CustomWebView,
    -  WebView.extraNativeComponentConfig
    +  WebView.extraNativeComponentConfig,
     );
     

    If you want to add custom props to your native component, you can use nativeConfig.props on the web view.

    @@ -223,7 +223,7 @@ const RCTCustomWebView = requireNativeComponent( ...WebView.extraNativeComponentConfig.nativeOnly, onScrollToBottom: true, }, - } + }, );
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.10/native-modules-ios/index.html b/docs/0.10/native-modules-ios/index.html index b17520fd9be..a481c951136 100644 --- a/docs/0.10/native-modules-ios/index.html +++ b/docs/0.10/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.10/network.html b/docs/0.10/network.html index 24338adfe2c..8a796a63e94 100644 --- a/docs/0.10/network.html +++ b/docs/0.10/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.10/network/index.html b/docs/0.10/network/index.html
    index 24338adfe2c..8a796a63e94 100644
    --- a/docs/0.10/network/index.html
    +++ b/docs/0.10/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.10/permissionsandroid.html b/docs/0.10/permissionsandroid.html
    index f3b940d54d4..4bbb45fbfb4 100644
    --- a/docs/0.10/permissionsandroid.html
    +++ b/docs/0.10/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.10/permissionsandroid/index.html b/docs/0.10/permissionsandroid/index.html
    index f3b940d54d4..4bbb45fbfb4 100644
    --- a/docs/0.10/permissionsandroid/index.html
    +++ b/docs/0.10/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.10/platform-specific-code.html b/docs/0.10/platform-specific-code.html
    index 7302d2a0695..7994b937be3 100644
    --- a/docs/0.10/platform-specific-code.html
    +++ b/docs/0.10/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.11/native-modules-ios/index.html b/docs/0.11/native-modules-ios/index.html index 6df8b02b48a..df0fe740a6a 100644 --- a/docs/0.11/native-modules-ios/index.html +++ b/docs/0.11/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.11/network.html b/docs/0.11/network.html index 2b67dc899b3..bf8a092bca4 100644 --- a/docs/0.11/network.html +++ b/docs/0.11/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.11/network/index.html b/docs/0.11/network/index.html
    index 2b67dc899b3..bf8a092bca4 100644
    --- a/docs/0.11/network/index.html
    +++ b/docs/0.11/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.11/permissionsandroid.html b/docs/0.11/permissionsandroid.html
    index 5f5bffb72a1..419fd95320e 100644
    --- a/docs/0.11/permissionsandroid.html
    +++ b/docs/0.11/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.11/permissionsandroid/index.html b/docs/0.11/permissionsandroid/index.html
    index 5f5bffb72a1..419fd95320e 100644
    --- a/docs/0.11/permissionsandroid/index.html
    +++ b/docs/0.11/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.11/platform-specific-code.html b/docs/0.11/platform-specific-code.html
    index 20521977768..407395959f8 100644
    --- a/docs/0.11/platform-specific-code.html
    +++ b/docs/0.11/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.12/native-modules-ios/index.html b/docs/0.12/native-modules-ios/index.html index 84f35dc2633..5b2026b7f4c 100644 --- a/docs/0.12/native-modules-ios/index.html +++ b/docs/0.12/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.12/network.html b/docs/0.12/network.html index f961857b192..145d1aaf982 100644 --- a/docs/0.12/network.html +++ b/docs/0.12/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.12/network/index.html b/docs/0.12/network/index.html
    index f961857b192..145d1aaf982 100644
    --- a/docs/0.12/network/index.html
    +++ b/docs/0.12/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.12/permissionsandroid.html b/docs/0.12/permissionsandroid.html
    index 44670aa8425..6f952d9dd38 100644
    --- a/docs/0.12/permissionsandroid.html
    +++ b/docs/0.12/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.12/permissionsandroid/index.html b/docs/0.12/permissionsandroid/index.html
    index 44670aa8425..6f952d9dd38 100644
    --- a/docs/0.12/permissionsandroid/index.html
    +++ b/docs/0.12/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.12/platform-specific-code.html b/docs/0.12/platform-specific-code.html
    index 32312bce1b8..5a115b02cc7 100644
    --- a/docs/0.12/platform-specific-code.html
    +++ b/docs/0.12/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.13/native-modules-ios/index.html b/docs/0.13/native-modules-ios/index.html index 3c92361473e..87da83d82e9 100644 --- a/docs/0.13/native-modules-ios/index.html +++ b/docs/0.13/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.13/network.html b/docs/0.13/network.html index 4b0cb026b82..3a0a2651b79 100644 --- a/docs/0.13/network.html +++ b/docs/0.13/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.13/network/index.html b/docs/0.13/network/index.html
    index 4b0cb026b82..3a0a2651b79 100644
    --- a/docs/0.13/network/index.html
    +++ b/docs/0.13/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.13/permissionsandroid.html b/docs/0.13/permissionsandroid.html
    index 6eb8a4f841e..e9027a0312f 100644
    --- a/docs/0.13/permissionsandroid.html
    +++ b/docs/0.13/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.13/permissionsandroid/index.html b/docs/0.13/permissionsandroid/index.html
    index 6eb8a4f841e..e9027a0312f 100644
    --- a/docs/0.13/permissionsandroid/index.html
    +++ b/docs/0.13/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.13/platform-specific-code.html b/docs/0.13/platform-specific-code.html
    index 67354c88152..8e7ad8c007f 100644
    --- a/docs/0.13/platform-specific-code.html
    +++ b/docs/0.13/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.14/native-modules-ios/index.html b/docs/0.14/native-modules-ios/index.html index 95d03079474..24624e89ed9 100644 --- a/docs/0.14/native-modules-ios/index.html +++ b/docs/0.14/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.14/network.html b/docs/0.14/network.html index e9efe5a5830..17a950b2e99 100644 --- a/docs/0.14/network.html +++ b/docs/0.14/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.14/network/index.html b/docs/0.14/network/index.html
    index e9efe5a5830..17a950b2e99 100644
    --- a/docs/0.14/network/index.html
    +++ b/docs/0.14/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.14/permissionsandroid.html b/docs/0.14/permissionsandroid.html
    index 7152e3feb20..9a1d9a16772 100644
    --- a/docs/0.14/permissionsandroid.html
    +++ b/docs/0.14/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.14/permissionsandroid/index.html b/docs/0.14/permissionsandroid/index.html
    index 7152e3feb20..9a1d9a16772 100644
    --- a/docs/0.14/permissionsandroid/index.html
    +++ b/docs/0.14/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.14/platform-specific-code.html b/docs/0.14/platform-specific-code.html
    index 711137505ab..cb67269d6f8 100644
    --- a/docs/0.14/platform-specific-code.html
    +++ b/docs/0.14/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.15/native-modules-ios/index.html b/docs/0.15/native-modules-ios/index.html index f058e334213..46d85371adc 100644 --- a/docs/0.15/native-modules-ios/index.html +++ b/docs/0.15/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.15/network.html b/docs/0.15/network.html index e43c855dcd9..8e79983984c 100644 --- a/docs/0.15/network.html +++ b/docs/0.15/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.15/network/index.html b/docs/0.15/network/index.html
    index e43c855dcd9..8e79983984c 100644
    --- a/docs/0.15/network/index.html
    +++ b/docs/0.15/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.15/permissionsandroid.html b/docs/0.15/permissionsandroid.html
    index 35c359113fc..5f6ab30f168 100644
    --- a/docs/0.15/permissionsandroid.html
    +++ b/docs/0.15/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.15/permissionsandroid/index.html b/docs/0.15/permissionsandroid/index.html
    index 35c359113fc..5f6ab30f168 100644
    --- a/docs/0.15/permissionsandroid/index.html
    +++ b/docs/0.15/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.15/platform-specific-code.html b/docs/0.15/platform-specific-code.html
    index 424a090aa06..93b4352acc7 100644
    --- a/docs/0.15/platform-specific-code.html
    +++ b/docs/0.15/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.16/native-modules-ios/index.html b/docs/0.16/native-modules-ios/index.html index 271852a3f10..9d1991c11fd 100644 --- a/docs/0.16/native-modules-ios/index.html +++ b/docs/0.16/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.16/network.html b/docs/0.16/network.html index 1fa106b41f7..ed0f7c26189 100644 --- a/docs/0.16/network.html +++ b/docs/0.16/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.16/network/index.html b/docs/0.16/network/index.html
    index 1fa106b41f7..ed0f7c26189 100644
    --- a/docs/0.16/network/index.html
    +++ b/docs/0.16/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.16/permissionsandroid.html b/docs/0.16/permissionsandroid.html
    index 10e3022d591..5d57f3798b1 100644
    --- a/docs/0.16/permissionsandroid.html
    +++ b/docs/0.16/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.16/permissionsandroid/index.html b/docs/0.16/permissionsandroid/index.html
    index 10e3022d591..5d57f3798b1 100644
    --- a/docs/0.16/permissionsandroid/index.html
    +++ b/docs/0.16/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.16/platform-specific-code.html b/docs/0.16/platform-specific-code.html
    index 581886fe728..451ef7a7594 100644
    --- a/docs/0.16/platform-specific-code.html
    +++ b/docs/0.16/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.17/native-modules-ios/index.html b/docs/0.17/native-modules-ios/index.html index 8afb311fe6d..542da681640 100644 --- a/docs/0.17/native-modules-ios/index.html +++ b/docs/0.17/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.17/network.html b/docs/0.17/network.html index f964761e3af..59f18a1ce78 100644 --- a/docs/0.17/network.html +++ b/docs/0.17/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.17/network/index.html b/docs/0.17/network/index.html
    index f964761e3af..59f18a1ce78 100644
    --- a/docs/0.17/network/index.html
    +++ b/docs/0.17/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.17/permissionsandroid.html b/docs/0.17/permissionsandroid.html
    index d95bdb42a0a..9bb2f51af2a 100644
    --- a/docs/0.17/permissionsandroid.html
    +++ b/docs/0.17/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.17/permissionsandroid/index.html b/docs/0.17/permissionsandroid/index.html
    index d95bdb42a0a..9bb2f51af2a 100644
    --- a/docs/0.17/permissionsandroid/index.html
    +++ b/docs/0.17/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.17/platform-specific-code.html b/docs/0.17/platform-specific-code.html
    index 3a1441a6669..4fbd3ae6e38 100644
    --- a/docs/0.17/platform-specific-code.html
    +++ b/docs/0.17/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.18/native-modules-ios/index.html b/docs/0.18/native-modules-ios/index.html index 483ba847ea2..bec1f40870b 100644 --- a/docs/0.18/native-modules-ios/index.html +++ b/docs/0.18/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.18/network.html b/docs/0.18/network.html index 2f7f79d6963..da295cb8604 100644 --- a/docs/0.18/network.html +++ b/docs/0.18/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.18/network/index.html b/docs/0.18/network/index.html
    index 2f7f79d6963..da295cb8604 100644
    --- a/docs/0.18/network/index.html
    +++ b/docs/0.18/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.18/permissionsandroid.html b/docs/0.18/permissionsandroid.html
    index 12642de050f..a47affc96c3 100644
    --- a/docs/0.18/permissionsandroid.html
    +++ b/docs/0.18/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.18/permissionsandroid/index.html b/docs/0.18/permissionsandroid/index.html
    index 12642de050f..a47affc96c3 100644
    --- a/docs/0.18/permissionsandroid/index.html
    +++ b/docs/0.18/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.18/platform-specific-code.html b/docs/0.18/platform-specific-code.html
    index 7b9f20e9066..de4e7d839f7 100644
    --- a/docs/0.18/platform-specific-code.html
    +++ b/docs/0.18/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.19/native-modules-ios/index.html b/docs/0.19/native-modules-ios/index.html index d82c53ccbfd..ab9d518cd76 100644 --- a/docs/0.19/native-modules-ios/index.html +++ b/docs/0.19/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.19/network.html b/docs/0.19/network.html index 4a8f5d7b148..5996bbb42df 100644 --- a/docs/0.19/network.html +++ b/docs/0.19/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.19/network/index.html b/docs/0.19/network/index.html
    index 4a8f5d7b148..5996bbb42df 100644
    --- a/docs/0.19/network/index.html
    +++ b/docs/0.19/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.19/permissionsandroid.html b/docs/0.19/permissionsandroid.html
    index f1a55f70754..43f1aca24f5 100644
    --- a/docs/0.19/permissionsandroid.html
    +++ b/docs/0.19/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.19/permissionsandroid/index.html b/docs/0.19/permissionsandroid/index.html
    index f1a55f70754..43f1aca24f5 100644
    --- a/docs/0.19/permissionsandroid/index.html
    +++ b/docs/0.19/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.19/platform-specific-code.html b/docs/0.19/platform-specific-code.html
    index ab9c705bed3..4d72d11f7d8 100644
    --- a/docs/0.19/platform-specific-code.html
    +++ b/docs/0.19/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.20/native-modules-ios/index.html b/docs/0.20/native-modules-ios/index.html index 5749cc8c145..35efcd6b02f 100644 --- a/docs/0.20/native-modules-ios/index.html +++ b/docs/0.20/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.20/network.html b/docs/0.20/network.html index 31446b46b18..624d9e72351 100644 --- a/docs/0.20/network.html +++ b/docs/0.20/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.20/network/index.html b/docs/0.20/network/index.html
    index 31446b46b18..624d9e72351 100644
    --- a/docs/0.20/network/index.html
    +++ b/docs/0.20/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.20/permissionsandroid.html b/docs/0.20/permissionsandroid.html
    index f131f9838c3..2eeb9734acc 100644
    --- a/docs/0.20/permissionsandroid.html
    +++ b/docs/0.20/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.20/permissionsandroid/index.html b/docs/0.20/permissionsandroid/index.html
    index f131f9838c3..2eeb9734acc 100644
    --- a/docs/0.20/permissionsandroid/index.html
    +++ b/docs/0.20/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.20/platform-specific-code.html b/docs/0.20/platform-specific-code.html
    index 524a53abd2b..73d1991d3b3 100644
    --- a/docs/0.20/platform-specific-code.html
    +++ b/docs/0.20/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.21/native-modules-ios/index.html b/docs/0.21/native-modules-ios/index.html index bf3e6c7f7ef..e034bb1c512 100644 --- a/docs/0.21/native-modules-ios/index.html +++ b/docs/0.21/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.21/network.html b/docs/0.21/network.html index 90897abea3a..41d78022187 100644 --- a/docs/0.21/network.html +++ b/docs/0.21/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.21/network/index.html b/docs/0.21/network/index.html
    index 90897abea3a..41d78022187 100644
    --- a/docs/0.21/network/index.html
    +++ b/docs/0.21/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.21/permissionsandroid.html b/docs/0.21/permissionsandroid.html
    index c22b9f4eb09..2016afe2a3a 100644
    --- a/docs/0.21/permissionsandroid.html
    +++ b/docs/0.21/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.21/permissionsandroid/index.html b/docs/0.21/permissionsandroid/index.html
    index c22b9f4eb09..2016afe2a3a 100644
    --- a/docs/0.21/permissionsandroid/index.html
    +++ b/docs/0.21/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.21/platform-specific-code.html b/docs/0.21/platform-specific-code.html
    index c6ae794d033..43b93648478 100644
    --- a/docs/0.21/platform-specific-code.html
    +++ b/docs/0.21/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.22/native-modules-ios/index.html b/docs/0.22/native-modules-ios/index.html index 56cb650b6df..66e60618f77 100644 --- a/docs/0.22/native-modules-ios/index.html +++ b/docs/0.22/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.22/network.html b/docs/0.22/network.html index 691195fa160..e859c58f21c 100644 --- a/docs/0.22/network.html +++ b/docs/0.22/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.22/network/index.html b/docs/0.22/network/index.html
    index 691195fa160..e859c58f21c 100644
    --- a/docs/0.22/network/index.html
    +++ b/docs/0.22/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.22/permissionsandroid.html b/docs/0.22/permissionsandroid.html
    index cef51c59856..c6e9d183f7a 100644
    --- a/docs/0.22/permissionsandroid.html
    +++ b/docs/0.22/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.22/permissionsandroid/index.html b/docs/0.22/permissionsandroid/index.html
    index cef51c59856..c6e9d183f7a 100644
    --- a/docs/0.22/permissionsandroid/index.html
    +++ b/docs/0.22/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.22/platform-specific-code.html b/docs/0.22/platform-specific-code.html
    index 3870813d4b8..fec0db0573e 100644
    --- a/docs/0.22/platform-specific-code.html
    +++ b/docs/0.22/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.23/native-modules-ios/index.html b/docs/0.23/native-modules-ios/index.html index 03fd6c49732..573978201dd 100644 --- a/docs/0.23/native-modules-ios/index.html +++ b/docs/0.23/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.23/network.html b/docs/0.23/network.html index ca627cb984f..a05ca40692b 100644 --- a/docs/0.23/network.html +++ b/docs/0.23/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.23/network/index.html b/docs/0.23/network/index.html
    index ca627cb984f..a05ca40692b 100644
    --- a/docs/0.23/network/index.html
    +++ b/docs/0.23/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.23/permissionsandroid.html b/docs/0.23/permissionsandroid.html
    index 1de582aa706..d5268765f78 100644
    --- a/docs/0.23/permissionsandroid.html
    +++ b/docs/0.23/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.23/permissionsandroid/index.html b/docs/0.23/permissionsandroid/index.html
    index 1de582aa706..d5268765f78 100644
    --- a/docs/0.23/permissionsandroid/index.html
    +++ b/docs/0.23/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.23/platform-specific-code.html b/docs/0.23/platform-specific-code.html
    index e45905e13be..d2f2c4fa62d 100644
    --- a/docs/0.23/platform-specific-code.html
    +++ b/docs/0.23/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.24/native-modules-ios/index.html b/docs/0.24/native-modules-ios/index.html index b09a28f55bd..71bfba12f88 100644 --- a/docs/0.24/native-modules-ios/index.html +++ b/docs/0.24/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.24/network.html b/docs/0.24/network.html index b9181858017..c18650d0c07 100644 --- a/docs/0.24/network.html +++ b/docs/0.24/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.24/network/index.html b/docs/0.24/network/index.html
    index b9181858017..c18650d0c07 100644
    --- a/docs/0.24/network/index.html
    +++ b/docs/0.24/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.24/permissionsandroid.html b/docs/0.24/permissionsandroid.html
    index 1d10868a2d3..17a48a1ea21 100644
    --- a/docs/0.24/permissionsandroid.html
    +++ b/docs/0.24/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.24/permissionsandroid/index.html b/docs/0.24/permissionsandroid/index.html
    index 1d10868a2d3..17a48a1ea21 100644
    --- a/docs/0.24/permissionsandroid/index.html
    +++ b/docs/0.24/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.24/platform-specific-code.html b/docs/0.24/platform-specific-code.html
    index c94f95ecded..e4f923a5925 100644
    --- a/docs/0.24/platform-specific-code.html
    +++ b/docs/0.24/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.25/native-modules-ios/index.html b/docs/0.25/native-modules-ios/index.html index 99d4221bab0..c0d29711911 100644 --- a/docs/0.25/native-modules-ios/index.html +++ b/docs/0.25/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.25/network.html b/docs/0.25/network.html index 1157a7fbc6d..1e641f00f31 100644 --- a/docs/0.25/network.html +++ b/docs/0.25/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.25/network/index.html b/docs/0.25/network/index.html
    index 1157a7fbc6d..1e641f00f31 100644
    --- a/docs/0.25/network/index.html
    +++ b/docs/0.25/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.25/permissionsandroid.html b/docs/0.25/permissionsandroid.html
    index e7ef2f217f7..5ddac535e64 100644
    --- a/docs/0.25/permissionsandroid.html
    +++ b/docs/0.25/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.25/permissionsandroid/index.html b/docs/0.25/permissionsandroid/index.html
    index e7ef2f217f7..5ddac535e64 100644
    --- a/docs/0.25/permissionsandroid/index.html
    +++ b/docs/0.25/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.25/platform-specific-code.html b/docs/0.25/platform-specific-code.html
    index e96b49e4a35..291b050404d 100644
    --- a/docs/0.25/platform-specific-code.html
    +++ b/docs/0.25/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.26/native-modules-ios/index.html b/docs/0.26/native-modules-ios/index.html index 213191aef97..9d640c78b1a 100644 --- a/docs/0.26/native-modules-ios/index.html +++ b/docs/0.26/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.26/network.html b/docs/0.26/network.html index ead417000fb..52bcce47f41 100644 --- a/docs/0.26/network.html +++ b/docs/0.26/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.26/network/index.html b/docs/0.26/network/index.html
    index ead417000fb..52bcce47f41 100644
    --- a/docs/0.26/network/index.html
    +++ b/docs/0.26/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.26/permissionsandroid.html b/docs/0.26/permissionsandroid.html
    index 04f549b7139..f894c632559 100644
    --- a/docs/0.26/permissionsandroid.html
    +++ b/docs/0.26/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.26/permissionsandroid/index.html b/docs/0.26/permissionsandroid/index.html
    index 04f549b7139..f894c632559 100644
    --- a/docs/0.26/permissionsandroid/index.html
    +++ b/docs/0.26/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.26/platform-specific-code.html b/docs/0.26/platform-specific-code.html
    index 264bf646f08..a810cda96f6 100644
    --- a/docs/0.26/platform-specific-code.html
    +++ b/docs/0.26/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.27/native-modules-ios/index.html b/docs/0.27/native-modules-ios/index.html index ca46907f7f4..b464269fb58 100644 --- a/docs/0.27/native-modules-ios/index.html +++ b/docs/0.27/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.27/network.html b/docs/0.27/network.html index 7606f9cd70b..7de731e167f 100644 --- a/docs/0.27/network.html +++ b/docs/0.27/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.27/network/index.html b/docs/0.27/network/index.html
    index 7606f9cd70b..7de731e167f 100644
    --- a/docs/0.27/network/index.html
    +++ b/docs/0.27/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.27/permissionsandroid.html b/docs/0.27/permissionsandroid.html
    index b817f1fbf1b..4b2b2a119e2 100644
    --- a/docs/0.27/permissionsandroid.html
    +++ b/docs/0.27/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.27/permissionsandroid/index.html b/docs/0.27/permissionsandroid/index.html
    index b817f1fbf1b..4b2b2a119e2 100644
    --- a/docs/0.27/permissionsandroid/index.html
    +++ b/docs/0.27/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.27/platform-specific-code.html b/docs/0.27/platform-specific-code.html
    index 20a48bcc40d..1ad23e04ad2 100644
    --- a/docs/0.27/platform-specific-code.html
    +++ b/docs/0.27/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.28/native-modules-ios/index.html b/docs/0.28/native-modules-ios/index.html index 95e7a12b9cf..cbaca5d7acf 100644 --- a/docs/0.28/native-modules-ios/index.html +++ b/docs/0.28/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.28/network.html b/docs/0.28/network.html index 5c3e243c645..408b08be7db 100644 --- a/docs/0.28/network.html +++ b/docs/0.28/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.28/network/index.html b/docs/0.28/network/index.html
    index 5c3e243c645..408b08be7db 100644
    --- a/docs/0.28/network/index.html
    +++ b/docs/0.28/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.28/permissionsandroid.html b/docs/0.28/permissionsandroid.html
    index 17e1decd9c0..9b42784349b 100644
    --- a/docs/0.28/permissionsandroid.html
    +++ b/docs/0.28/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.28/permissionsandroid/index.html b/docs/0.28/permissionsandroid/index.html
    index 17e1decd9c0..9b42784349b 100644
    --- a/docs/0.28/permissionsandroid/index.html
    +++ b/docs/0.28/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.28/platform-specific-code.html b/docs/0.28/platform-specific-code.html
    index b11f672db72..1064048b4be 100644
    --- a/docs/0.28/platform-specific-code.html
    +++ b/docs/0.28/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.29/native-modules-ios/index.html b/docs/0.29/native-modules-ios/index.html index ff23991ec65..b2860d00109 100644 --- a/docs/0.29/native-modules-ios/index.html +++ b/docs/0.29/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.29/network.html b/docs/0.29/network.html index 2ec1d917c33..fd1cd18b32c 100644 --- a/docs/0.29/network.html +++ b/docs/0.29/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.29/network/index.html b/docs/0.29/network/index.html
    index 2ec1d917c33..fd1cd18b32c 100644
    --- a/docs/0.29/network/index.html
    +++ b/docs/0.29/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.29/permissionsandroid.html b/docs/0.29/permissionsandroid.html
    index 81e1f8eb6ba..c17682a6e5b 100644
    --- a/docs/0.29/permissionsandroid.html
    +++ b/docs/0.29/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.29/permissionsandroid/index.html b/docs/0.29/permissionsandroid/index.html
    index 81e1f8eb6ba..c17682a6e5b 100644
    --- a/docs/0.29/permissionsandroid/index.html
    +++ b/docs/0.29/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.29/platform-specific-code.html b/docs/0.29/platform-specific-code.html
    index 7f9f19bff06..9fd785703ec 100644
    --- a/docs/0.29/platform-specific-code.html
    +++ b/docs/0.29/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.30/native-modules-ios/index.html b/docs/0.30/native-modules-ios/index.html index 31fd1f8ddc3..a23f2bb852f 100644 --- a/docs/0.30/native-modules-ios/index.html +++ b/docs/0.30/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.30/network.html b/docs/0.30/network.html index ad9412dafb7..65d5e34c843 100644 --- a/docs/0.30/network.html +++ b/docs/0.30/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.30/network/index.html b/docs/0.30/network/index.html
    index ad9412dafb7..65d5e34c843 100644
    --- a/docs/0.30/network/index.html
    +++ b/docs/0.30/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.30/permissionsandroid.html b/docs/0.30/permissionsandroid.html
    index 146b64156cd..b987d51c5ed 100644
    --- a/docs/0.30/permissionsandroid.html
    +++ b/docs/0.30/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.30/permissionsandroid/index.html b/docs/0.30/permissionsandroid/index.html
    index 146b64156cd..b987d51c5ed 100644
    --- a/docs/0.30/permissionsandroid/index.html
    +++ b/docs/0.30/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.30/platform-specific-code.html b/docs/0.30/platform-specific-code.html
    index 3e9463d8cf1..44d7c09ad49 100644
    --- a/docs/0.30/platform-specific-code.html
    +++ b/docs/0.30/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.31/native-modules-ios/index.html b/docs/0.31/native-modules-ios/index.html index bbbdb07fa6b..55dc414ffbf 100644 --- a/docs/0.31/native-modules-ios/index.html +++ b/docs/0.31/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.31/network.html b/docs/0.31/network.html index f359de890f9..fd88b8f4968 100644 --- a/docs/0.31/network.html +++ b/docs/0.31/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.31/network/index.html b/docs/0.31/network/index.html
    index f359de890f9..fd88b8f4968 100644
    --- a/docs/0.31/network/index.html
    +++ b/docs/0.31/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.31/permissionsandroid.html b/docs/0.31/permissionsandroid.html
    index 2db8fd3f70d..65d19029ce6 100644
    --- a/docs/0.31/permissionsandroid.html
    +++ b/docs/0.31/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.31/permissionsandroid/index.html b/docs/0.31/permissionsandroid/index.html
    index 2db8fd3f70d..65d19029ce6 100644
    --- a/docs/0.31/permissionsandroid/index.html
    +++ b/docs/0.31/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.31/platform-specific-code.html b/docs/0.31/platform-specific-code.html
    index c33bd78ef6c..677bc9cadf0 100644
    --- a/docs/0.31/platform-specific-code.html
    +++ b/docs/0.31/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.32/native-modules-ios/index.html b/docs/0.32/native-modules-ios/index.html index 8f35acbe86e..60238fe07fa 100644 --- a/docs/0.32/native-modules-ios/index.html +++ b/docs/0.32/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.32/network.html b/docs/0.32/network.html index df9bce5bf53..50bae96a451 100644 --- a/docs/0.32/network.html +++ b/docs/0.32/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.32/network/index.html b/docs/0.32/network/index.html
    index df9bce5bf53..50bae96a451 100644
    --- a/docs/0.32/network/index.html
    +++ b/docs/0.32/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.32/permissionsandroid.html b/docs/0.32/permissionsandroid.html
    index 65834a3ef2b..c4f80ad260e 100644
    --- a/docs/0.32/permissionsandroid.html
    +++ b/docs/0.32/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.32/permissionsandroid/index.html b/docs/0.32/permissionsandroid/index.html
    index 65834a3ef2b..c4f80ad260e 100644
    --- a/docs/0.32/permissionsandroid/index.html
    +++ b/docs/0.32/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.32/platform-specific-code.html b/docs/0.32/platform-specific-code.html
    index 276ff431cb4..a1825f7be01 100644
    --- a/docs/0.32/platform-specific-code.html
    +++ b/docs/0.32/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.33/native-modules-ios/index.html b/docs/0.33/native-modules-ios/index.html index 53919459f62..03ab8be8fe7 100644 --- a/docs/0.33/native-modules-ios/index.html +++ b/docs/0.33/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.33/network.html b/docs/0.33/network.html index 39ffb3afb2a..0fd5b7f4f7d 100644 --- a/docs/0.33/network.html +++ b/docs/0.33/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.33/network/index.html b/docs/0.33/network/index.html
    index 39ffb3afb2a..0fd5b7f4f7d 100644
    --- a/docs/0.33/network/index.html
    +++ b/docs/0.33/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.33/platform-specific-code.html b/docs/0.33/platform-specific-code.html
    index f7f855ab7c2..bd0dcc4e058 100644
    --- a/docs/0.33/platform-specific-code.html
    +++ b/docs/0.33/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.34/native-modules-ios/index.html b/docs/0.34/native-modules-ios/index.html index 7830025a57e..7b2aa8bd1e7 100644 --- a/docs/0.34/native-modules-ios/index.html +++ b/docs/0.34/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.34/network.html b/docs/0.34/network.html index 432e0bf0d43..1b8356c2e30 100644 --- a/docs/0.34/network.html +++ b/docs/0.34/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.34/network/index.html b/docs/0.34/network/index.html
    index 432e0bf0d43..1b8356c2e30 100644
    --- a/docs/0.34/network/index.html
    +++ b/docs/0.34/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.34/platform-specific-code.html b/docs/0.34/platform-specific-code.html
    index 16657b9dc82..2b32e4edd05 100644
    --- a/docs/0.34/platform-specific-code.html
    +++ b/docs/0.34/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.35/native-modules-ios/index.html b/docs/0.35/native-modules-ios/index.html index 787cf358820..4cdeaa94ce5 100644 --- a/docs/0.35/native-modules-ios/index.html +++ b/docs/0.35/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.35/network.html b/docs/0.35/network.html index ff609587ad6..d5b7f1b01a7 100644 --- a/docs/0.35/network.html +++ b/docs/0.35/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.35/network/index.html b/docs/0.35/network/index.html
    index ff609587ad6..d5b7f1b01a7 100644
    --- a/docs/0.35/network/index.html
    +++ b/docs/0.35/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.35/platform-specific-code.html b/docs/0.35/platform-specific-code.html
    index 814923d217f..40a4657367b 100644
    --- a/docs/0.35/platform-specific-code.html
    +++ b/docs/0.35/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.36/native-modules-ios/index.html b/docs/0.36/native-modules-ios/index.html index bfdee4f7fe6..db36d9ae244 100644 --- a/docs/0.36/native-modules-ios/index.html +++ b/docs/0.36/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.36/network.html b/docs/0.36/network.html index 87d63f5a7a7..2ddc6627e0d 100644 --- a/docs/0.36/network.html +++ b/docs/0.36/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.36/network/index.html b/docs/0.36/network/index.html
    index 87d63f5a7a7..2ddc6627e0d 100644
    --- a/docs/0.36/network/index.html
    +++ b/docs/0.36/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.36/platform-specific-code.html b/docs/0.36/platform-specific-code.html
    index 620c490cf32..a1d5361b537 100644
    --- a/docs/0.36/platform-specific-code.html
    +++ b/docs/0.36/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.37/native-modules-ios/index.html b/docs/0.37/native-modules-ios/index.html index 4c458cec352..6e7665830db 100644 --- a/docs/0.37/native-modules-ios/index.html +++ b/docs/0.37/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.37/network.html b/docs/0.37/network.html index abe917128ea..f9b3f3f529a 100644 --- a/docs/0.37/network.html +++ b/docs/0.37/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.37/network/index.html b/docs/0.37/network/index.html
    index abe917128ea..f9b3f3f529a 100644
    --- a/docs/0.37/network/index.html
    +++ b/docs/0.37/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.37/platform-specific-code.html b/docs/0.37/platform-specific-code.html
    index 3d0a3b0ca91..916ba05cf46 100644
    --- a/docs/0.37/platform-specific-code.html
    +++ b/docs/0.37/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.38/native-modules-ios/index.html b/docs/0.38/native-modules-ios/index.html index 6a3275841cc..ceb308efb9a 100644 --- a/docs/0.38/native-modules-ios/index.html +++ b/docs/0.38/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.38/network.html b/docs/0.38/network.html index 526ae4b99aa..b8ee4833874 100644 --- a/docs/0.38/network.html +++ b/docs/0.38/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.38/network/index.html b/docs/0.38/network/index.html
    index 526ae4b99aa..b8ee4833874 100644
    --- a/docs/0.38/network/index.html
    +++ b/docs/0.38/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.38/platform-specific-code.html b/docs/0.38/platform-specific-code.html
    index 05ddd990174..a31623a398b 100644
    --- a/docs/0.38/platform-specific-code.html
    +++ b/docs/0.38/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.39/native-modules-ios/index.html b/docs/0.39/native-modules-ios/index.html index 007fc01cf26..381c1972f10 100644 --- a/docs/0.39/native-modules-ios/index.html +++ b/docs/0.39/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.39/network.html b/docs/0.39/network.html index 1d6ab1b6192..982c7528d8d 100644 --- a/docs/0.39/network.html +++ b/docs/0.39/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.39/network/index.html b/docs/0.39/network/index.html
    index 1d6ab1b6192..982c7528d8d 100644
    --- a/docs/0.39/network/index.html
    +++ b/docs/0.39/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.39/platform-specific-code.html b/docs/0.39/platform-specific-code.html
    index 405cd72c08f..84ae1b5ce84 100644
    --- a/docs/0.39/platform-specific-code.html
    +++ b/docs/0.39/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.40/native-modules-ios/index.html b/docs/0.40/native-modules-ios/index.html index cfc9eee90ad..f57d52719b2 100644 --- a/docs/0.40/native-modules-ios/index.html +++ b/docs/0.40/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.40/network.html b/docs/0.40/network.html index 704d1290406..6f04317c3eb 100644 --- a/docs/0.40/network.html +++ b/docs/0.40/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.40/network/index.html b/docs/0.40/network/index.html
    index 704d1290406..6f04317c3eb 100644
    --- a/docs/0.40/network/index.html
    +++ b/docs/0.40/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.40/platform-specific-code.html b/docs/0.40/platform-specific-code.html
    index 47a6a95f591..86243da21db 100644
    --- a/docs/0.40/platform-specific-code.html
    +++ b/docs/0.40/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.41/native-modules-ios/index.html b/docs/0.41/native-modules-ios/index.html index 4caa8450552..7b3598b203a 100644 --- a/docs/0.41/native-modules-ios/index.html +++ b/docs/0.41/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.41/network.html b/docs/0.41/network.html index ec7c49a8ff1..fa64ec394be 100644 --- a/docs/0.41/network.html +++ b/docs/0.41/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.41/network/index.html b/docs/0.41/network/index.html
    index ec7c49a8ff1..fa64ec394be 100644
    --- a/docs/0.41/network/index.html
    +++ b/docs/0.41/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.41/platform-specific-code.html b/docs/0.41/platform-specific-code.html
    index f649c2f80dd..e636b0035dd 100644
    --- a/docs/0.41/platform-specific-code.html
    +++ b/docs/0.41/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.42/native-modules-ios/index.html b/docs/0.42/native-modules-ios/index.html index 3261420f01d..b944aeb89b7 100644 --- a/docs/0.42/native-modules-ios/index.html +++ b/docs/0.42/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.42/network.html b/docs/0.42/network.html index d0d219838bc..ba7b673999b 100644 --- a/docs/0.42/network.html +++ b/docs/0.42/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.42/network/index.html b/docs/0.42/network/index.html
    index d0d219838bc..ba7b673999b 100644
    --- a/docs/0.42/network/index.html
    +++ b/docs/0.42/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.42/platform-specific-code.html b/docs/0.42/platform-specific-code.html
    index 1cff7c63091..ddc89e151f0 100644
    --- a/docs/0.42/platform-specific-code.html
    +++ b/docs/0.42/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.43/native-modules-ios/index.html b/docs/0.43/native-modules-ios/index.html index 04e030b8123..4313b4ecbd2 100644 --- a/docs/0.43/native-modules-ios/index.html +++ b/docs/0.43/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.43/network.html b/docs/0.43/network.html index dd61b233ce9..6162770ddde 100644 --- a/docs/0.43/network.html +++ b/docs/0.43/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.43/network/index.html b/docs/0.43/network/index.html
    index dd61b233ce9..6162770ddde 100644
    --- a/docs/0.43/network/index.html
    +++ b/docs/0.43/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.43/platform-specific-code.html b/docs/0.43/platform-specific-code.html
    index b8597806202..8d4b500fe0f 100644
    --- a/docs/0.43/platform-specific-code.html
    +++ b/docs/0.43/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.44/native-modules-ios/index.html b/docs/0.44/native-modules-ios/index.html index 9b44eeb3d9c..9f82e0550ec 100644 --- a/docs/0.44/native-modules-ios/index.html +++ b/docs/0.44/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.44/network.html b/docs/0.44/network.html index 4b1f29580f4..0029da38194 100644 --- a/docs/0.44/network.html +++ b/docs/0.44/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.44/network/index.html b/docs/0.44/network/index.html
    index 4b1f29580f4..0029da38194 100644
    --- a/docs/0.44/network/index.html
    +++ b/docs/0.44/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.44/platform-specific-code.html b/docs/0.44/platform-specific-code.html
    index cae108d5f82..16a0b2ef8d1 100644
    --- a/docs/0.44/platform-specific-code.html
    +++ b/docs/0.44/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.45/native-modules-ios/index.html b/docs/0.45/native-modules-ios/index.html index 7b52367cb27..456dd697e6f 100644 --- a/docs/0.45/native-modules-ios/index.html +++ b/docs/0.45/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.45/network.html b/docs/0.45/network.html index eda99983768..b6ba820b238 100644 --- a/docs/0.45/network.html +++ b/docs/0.45/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.45/network/index.html b/docs/0.45/network/index.html
    index eda99983768..b6ba820b238 100644
    --- a/docs/0.45/network/index.html
    +++ b/docs/0.45/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.45/platform-specific-code.html b/docs/0.45/platform-specific-code.html
    index d43a768a5ba..99448c264dc 100644
    --- a/docs/0.45/platform-specific-code.html
    +++ b/docs/0.45/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.46/native-modules-ios/index.html b/docs/0.46/native-modules-ios/index.html index 011088f0cf1..777a5130aa1 100644 --- a/docs/0.46/native-modules-ios/index.html +++ b/docs/0.46/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.46/network.html b/docs/0.46/network.html index 4460ecbfe5f..b2f72b2b40d 100644 --- a/docs/0.46/network.html +++ b/docs/0.46/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.46/network/index.html b/docs/0.46/network/index.html
    index 4460ecbfe5f..b2f72b2b40d 100644
    --- a/docs/0.46/network/index.html
    +++ b/docs/0.46/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.46/platform-specific-code.html b/docs/0.46/platform-specific-code.html
    index d1a70b04a05..6c0ce1648c9 100644
    --- a/docs/0.46/platform-specific-code.html
    +++ b/docs/0.46/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.47/native-modules-ios/index.html b/docs/0.47/native-modules-ios/index.html index a7c389e158e..7348bfa513b 100644 --- a/docs/0.47/native-modules-ios/index.html +++ b/docs/0.47/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.47/network.html b/docs/0.47/network.html index 50854900a40..c0241170986 100644 --- a/docs/0.47/network.html +++ b/docs/0.47/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.47/network/index.html b/docs/0.47/network/index.html
    index 50854900a40..c0241170986 100644
    --- a/docs/0.47/network/index.html
    +++ b/docs/0.47/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.47/platform-specific-code.html b/docs/0.47/platform-specific-code.html
    index e759864d4d7..1b14af0a53d 100644
    --- a/docs/0.47/platform-specific-code.html
    +++ b/docs/0.47/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.48/native-modules-ios/index.html b/docs/0.48/native-modules-ios/index.html index 5856a3cc790..f106498277c 100644 --- a/docs/0.48/native-modules-ios/index.html +++ b/docs/0.48/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.48/network.html b/docs/0.48/network.html index df8b16ff3eb..5ba11acc752 100644 --- a/docs/0.48/network.html +++ b/docs/0.48/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.48/network/index.html b/docs/0.48/network/index.html
    index df8b16ff3eb..5ba11acc752 100644
    --- a/docs/0.48/network/index.html
    +++ b/docs/0.48/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.48/platform-specific-code.html b/docs/0.48/platform-specific-code.html
    index 8af5580c233..10b34576c86 100644
    --- a/docs/0.48/platform-specific-code.html
    +++ b/docs/0.48/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.49/native-modules-ios/index.html b/docs/0.49/native-modules-ios/index.html index 9f96afeec9d..49003c1bedc 100644 --- a/docs/0.49/native-modules-ios/index.html +++ b/docs/0.49/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.49/network.html b/docs/0.49/network.html index b472cd6a02d..f512e523d49 100644 --- a/docs/0.49/network.html +++ b/docs/0.49/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.49/network/index.html b/docs/0.49/network/index.html
    index b472cd6a02d..f512e523d49 100644
    --- a/docs/0.49/network/index.html
    +++ b/docs/0.49/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.49/platform-specific-code.html b/docs/0.49/platform-specific-code.html
    index 25ad8a42509..ac21a1e8040 100644
    --- a/docs/0.49/platform-specific-code.html
    +++ b/docs/0.49/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.5/native-modules-ios/index.html b/docs/0.5/native-modules-ios/index.html index d91961635e0..3a4b9fa14cc 100644 --- a/docs/0.5/native-modules-ios/index.html +++ b/docs/0.5/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.5/network.html b/docs/0.5/network.html index 0ea17a1bdb1..ea118003df4 100644 --- a/docs/0.5/network.html +++ b/docs/0.5/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.5/network/index.html b/docs/0.5/network/index.html
    index 0ea17a1bdb1..ea118003df4 100644
    --- a/docs/0.5/network/index.html
    +++ b/docs/0.5/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.5/permissionsandroid.html b/docs/0.5/permissionsandroid.html
    index e074ec760fe..0c029ae6056 100644
    --- a/docs/0.5/permissionsandroid.html
    +++ b/docs/0.5/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.5/permissionsandroid/index.html b/docs/0.5/permissionsandroid/index.html
    index e074ec760fe..0c029ae6056 100644
    --- a/docs/0.5/permissionsandroid/index.html
    +++ b/docs/0.5/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.5/platform-specific-code.html b/docs/0.5/platform-specific-code.html
    index 5b60a19bbb2..8167f92fc9c 100644
    --- a/docs/0.5/platform-specific-code.html
    +++ b/docs/0.5/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.50/native-modules-ios/index.html b/docs/0.50/native-modules-ios/index.html index 33575d7a2d5..7ab244ecce7 100644 --- a/docs/0.50/native-modules-ios/index.html +++ b/docs/0.50/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.50/network.html b/docs/0.50/network.html index eee2eed6c84..69a81559261 100644 --- a/docs/0.50/network.html +++ b/docs/0.50/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.50/network/index.html b/docs/0.50/network/index.html
    index eee2eed6c84..69a81559261 100644
    --- a/docs/0.50/network/index.html
    +++ b/docs/0.50/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.50/platform-specific-code.html b/docs/0.50/platform-specific-code.html
    index c13e3b4c158..31f4a58d307 100644
    --- a/docs/0.50/platform-specific-code.html
    +++ b/docs/0.50/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.51/native-modules-ios/index.html b/docs/0.51/native-modules-ios/index.html index 6a243722e3f..28d72e1b65a 100644 --- a/docs/0.51/native-modules-ios/index.html +++ b/docs/0.51/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.51/network.html b/docs/0.51/network.html index 6cea903a653..2e8fb80f132 100644 --- a/docs/0.51/network.html +++ b/docs/0.51/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.51/network/index.html b/docs/0.51/network/index.html
    index 6cea903a653..2e8fb80f132 100644
    --- a/docs/0.51/network/index.html
    +++ b/docs/0.51/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.51/platform-specific-code.html b/docs/0.51/platform-specific-code.html
    index f8cbe891ec0..8fbd1b68e4b 100644
    --- a/docs/0.51/platform-specific-code.html
    +++ b/docs/0.51/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.52/native-modules-ios/index.html b/docs/0.52/native-modules-ios/index.html index 0fb2a8e5823..17ff8defc4c 100644 --- a/docs/0.52/native-modules-ios/index.html +++ b/docs/0.52/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.52/network.html b/docs/0.52/network.html index f931db7cb6b..77f50f4c521 100644 --- a/docs/0.52/network.html +++ b/docs/0.52/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.52/network/index.html b/docs/0.52/network/index.html
    index f931db7cb6b..77f50f4c521 100644
    --- a/docs/0.52/network/index.html
    +++ b/docs/0.52/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.52/platform-specific-code.html b/docs/0.52/platform-specific-code.html
    index 644336aa595..5f655f62857 100644
    --- a/docs/0.52/platform-specific-code.html
    +++ b/docs/0.52/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.53/native-modules-ios/index.html b/docs/0.53/native-modules-ios/index.html index a1de44455e1..c223a9a47f5 100644 --- a/docs/0.53/native-modules-ios/index.html +++ b/docs/0.53/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.53/network.html b/docs/0.53/network.html index f9ddd9e9e66..9b7bb5c571d 100644 --- a/docs/0.53/network.html +++ b/docs/0.53/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.53/network/index.html b/docs/0.53/network/index.html
    index f9ddd9e9e66..9b7bb5c571d 100644
    --- a/docs/0.53/network/index.html
    +++ b/docs/0.53/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.53/platform-specific-code.html b/docs/0.53/platform-specific-code.html
    index f88ed4d5314..f021be6226f 100644
    --- a/docs/0.53/platform-specific-code.html
    +++ b/docs/0.53/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.54/native-modules-ios/index.html b/docs/0.54/native-modules-ios/index.html index e5d19c458c8..4ed1def49f8 100644 --- a/docs/0.54/native-modules-ios/index.html +++ b/docs/0.54/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.54/network.html b/docs/0.54/network.html index 3cc287ba8bb..7167747d4d2 100644 --- a/docs/0.54/network.html +++ b/docs/0.54/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.54/network/index.html b/docs/0.54/network/index.html
    index 3cc287ba8bb..7167747d4d2 100644
    --- a/docs/0.54/network/index.html
    +++ b/docs/0.54/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.54/platform-specific-code.html b/docs/0.54/platform-specific-code.html
    index 8e40d1adcc0..a5a5fa74c8d 100644
    --- a/docs/0.54/platform-specific-code.html
    +++ b/docs/0.54/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.55/native-modules-ios/index.html b/docs/0.55/native-modules-ios/index.html index 8b26f9c41dd..69cffc0b0f8 100644 --- a/docs/0.55/native-modules-ios/index.html +++ b/docs/0.55/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.55/network.html b/docs/0.55/network.html index f07668a49db..d4d9d1c02dc 100644 --- a/docs/0.55/network.html +++ b/docs/0.55/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.55/network/index.html b/docs/0.55/network/index.html
    index f07668a49db..d4d9d1c02dc 100644
    --- a/docs/0.55/network/index.html
    +++ b/docs/0.55/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.55/platform-specific-code.html b/docs/0.55/platform-specific-code.html
    index 7873613ee80..d66835d7bc6 100644
    --- a/docs/0.55/platform-specific-code.html
    +++ b/docs/0.55/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.56/native-modules-ios/index.html b/docs/0.56/native-modules-ios/index.html index 43fb5277190..ff942a4a09f 100644 --- a/docs/0.56/native-modules-ios/index.html +++ b/docs/0.56/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.56/network.html b/docs/0.56/network.html index d9881d627c1..f054c2d5ca7 100644 --- a/docs/0.56/network.html +++ b/docs/0.56/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.56/network/index.html b/docs/0.56/network/index.html
    index d9881d627c1..f054c2d5ca7 100644
    --- a/docs/0.56/network/index.html
    +++ b/docs/0.56/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.56/platform-specific-code.html b/docs/0.56/platform-specific-code.html
    index 883b8611f7f..c07f03f0eb4 100644
    --- a/docs/0.56/platform-specific-code.html
    +++ b/docs/0.56/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.6/native-modules-ios/index.html b/docs/0.6/native-modules-ios/index.html index 59a0143a15e..61c9e902238 100644 --- a/docs/0.6/native-modules-ios/index.html +++ b/docs/0.6/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.6/network.html b/docs/0.6/network.html index 6a3c3416a73..e8855a1b218 100644 --- a/docs/0.6/network.html +++ b/docs/0.6/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.6/network/index.html b/docs/0.6/network/index.html
    index 6a3c3416a73..e8855a1b218 100644
    --- a/docs/0.6/network/index.html
    +++ b/docs/0.6/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.6/permissionsandroid.html b/docs/0.6/permissionsandroid.html
    index c36c7753b1f..2bf9e5f5653 100644
    --- a/docs/0.6/permissionsandroid.html
    +++ b/docs/0.6/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.6/permissionsandroid/index.html b/docs/0.6/permissionsandroid/index.html
    index c36c7753b1f..2bf9e5f5653 100644
    --- a/docs/0.6/permissionsandroid/index.html
    +++ b/docs/0.6/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.6/platform-specific-code.html b/docs/0.6/platform-specific-code.html
    index 00b95c9a333..cae95b2659e 100644
    --- a/docs/0.6/platform-specific-code.html
    +++ b/docs/0.6/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.7/native-modules-ios/index.html b/docs/0.7/native-modules-ios/index.html index 5ce27f428aa..dfb8a69c0a6 100644 --- a/docs/0.7/native-modules-ios/index.html +++ b/docs/0.7/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.7/network.html b/docs/0.7/network.html index af18fabe48c..90cac5df52a 100644 --- a/docs/0.7/network.html +++ b/docs/0.7/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.7/network/index.html b/docs/0.7/network/index.html
    index af18fabe48c..90cac5df52a 100644
    --- a/docs/0.7/network/index.html
    +++ b/docs/0.7/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.7/permissionsandroid.html b/docs/0.7/permissionsandroid.html
    index a35c7f3742d..03339da17bd 100644
    --- a/docs/0.7/permissionsandroid.html
    +++ b/docs/0.7/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.7/permissionsandroid/index.html b/docs/0.7/permissionsandroid/index.html
    index a35c7f3742d..03339da17bd 100644
    --- a/docs/0.7/permissionsandroid/index.html
    +++ b/docs/0.7/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.7/platform-specific-code.html b/docs/0.7/platform-specific-code.html
    index 5d6d0ee3fb5..4b299b28c2e 100644
    --- a/docs/0.7/platform-specific-code.html
    +++ b/docs/0.7/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.8/native-modules-ios/index.html b/docs/0.8/native-modules-ios/index.html index 553cddce96c..b9f073090b4 100644 --- a/docs/0.8/native-modules-ios/index.html +++ b/docs/0.8/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.8/network.html b/docs/0.8/network.html index ad60bbe370e..617a5af5a75 100644 --- a/docs/0.8/network.html +++ b/docs/0.8/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.8/network/index.html b/docs/0.8/network/index.html
    index ad60bbe370e..617a5af5a75 100644
    --- a/docs/0.8/network/index.html
    +++ b/docs/0.8/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.8/permissionsandroid.html b/docs/0.8/permissionsandroid.html
    index 99e75a26da2..f1d61bce56f 100644
    --- a/docs/0.8/permissionsandroid.html
    +++ b/docs/0.8/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.8/permissionsandroid/index.html b/docs/0.8/permissionsandroid/index.html
    index 99e75a26da2..f1d61bce56f 100644
    --- a/docs/0.8/permissionsandroid/index.html
    +++ b/docs/0.8/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.8/platform-specific-code.html b/docs/0.8/platform-specific-code.html
    index a636d310f8b..69b88c2a49d 100644
    --- a/docs/0.8/platform-specific-code.html
    +++ b/docs/0.8/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.9/native-modules-ios/index.html b/docs/0.9/native-modules-ios/index.html index a87e0a815d8..780898a59ea 100644 --- a/docs/0.9/native-modules-ios/index.html +++ b/docs/0.9/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/0.9/network.html b/docs/0.9/network.html index d00780b8264..4f3bf920b8a 100644 --- a/docs/0.9/network.html +++ b/docs/0.9/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.9/network/index.html b/docs/0.9/network/index.html
    index d00780b8264..4f3bf920b8a 100644
    --- a/docs/0.9/network/index.html
    +++ b/docs/0.9/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/0.9/permissionsandroid.html b/docs/0.9/permissionsandroid.html
    index b07e8d0196b..a2f2a7b19ae 100644
    --- a/docs/0.9/permissionsandroid.html
    +++ b/docs/0.9/permissionsandroid.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.9/permissionsandroid/index.html b/docs/0.9/permissionsandroid/index.html
    index b07e8d0196b..a2f2a7b19ae 100644
    --- a/docs/0.9/permissionsandroid/index.html
    +++ b/docs/0.9/permissionsandroid/index.html
    @@ -31,7 +31,7 @@
             message:
               'Cool Photo App needs access to your camera ' +
               'so you can take awesome pictures.',
    -      }
    +      },
         );
         if (granted === PermissionsAndroid.RESULTS.GRANTED) {
           console.log('You can use the camera');
    diff --git a/docs/0.9/platform-specific-code.html b/docs/0.9/platform-specific-code.html
    index 1292a4fbd08..eda0bd74238 100644
    --- a/docs/0.9/platform-specific-code.html
    +++ b/docs/0.9/platform-specific-code.html
    @@ -102,6 +102,7 @@ BigButton.android.js
     
    const BigButton = require('./BigButton');
     

    React Native will automatically pick up the right file based on the running platform.

    +

    If you share your React Native code with a website, you might as well use the BigButton.native.js so that both iOS and Android will use this file, while the website will use BigButton.js.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/native-modules-ios/index.html b/docs/native-modules-ios/index.html index 5568bafb81f..7bf084c6102 100644 --- a/docs/native-modules-ios/index.html +++ b/docs/native-modules-ios/index.html @@ -1,4 +1,4 @@ -Native Modules · React Native
    Edit

    Native Modules

    Sometimes an app needs access to platform API, and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    +
    Edit

    Native Modules

    Sometimes an app needs to access a platform API and React Native doesn't have a corresponding module yet. Maybe you want to reuse some existing Objective-C, Swift or C++ code without having to reimplement it in JavaScript, or write some high performance, multi-threaded code such as for image processing, a database, or any number of advanced extensions.

    We designed React Native such that it is possible for you to write real native code and have access to the full power of the platform. This is a more advanced feature and we don't expect it to be part of the usual development process, however it is essential that it exists. If React Native doesn't support a native feature that you need, you should be able to build it yourself.

    This is a more advanced guide that shows how to build a native module. It assumes the reader knows Objective-C or Swift and core libraries (Foundation, UIKit).

    Native Module Setup

    @@ -117,14 +117,14 @@ CalendarManager.addEvent('Birthday Party', CalendarManager.addEvent( 'Birthday Party', '4 Privet Drive, Surrey', - date.getTime() + date.getTime(), ); // passing date as number of milliseconds since Unix epoch

    or

    CalendarManager.addEvent(
       'Birthday Party',
       '4 Privet Drive, Surrey',
    -  date.toISOString()
    +  date.toISOString(),
     ); // passing date as ISO-8601 string
     

    And both values would get converted correctly to the native NSDate. A bad value, like an Array, would generate a helpful "RedBox" error message.

    diff --git a/docs/network.html b/docs/network.html index f5ebec2fcb5..844632b19c0 100644 --- a/docs/network.html +++ b/docs/network.html @@ -72,7 +72,7 @@
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/network/index.html b/docs/network/index.html
    index f5ebec2fcb5..844632b19c0 100644
    --- a/docs/network/index.html
    +++ b/docs/network/index.html
    @@ -72,7 +72,7 @@
     
    async function getMoviesFromApi() {
       try {
         let response = await fetch(
    -      'https://facebook.github.io/react-native/movies.json'
    +      'https://facebook.github.io/react-native/movies.json',
         );
         let responseJson = await response.json();
         return responseJson.movies;
    diff --git a/docs/next/accessibilityinfo.html b/docs/next/accessibilityinfo.html
    index ba96563a229..4cf45047d12 100644
    --- a/docs/next/accessibilityinfo.html
    +++ b/docs/next/accessibilityinfo.html
    @@ -43,7 +43,7 @@
       componentDidMount() {
         AccessibilityInfo.addEventListener(
           'change',
    -      this._handleScreenReaderToggled
    +      this._handleScreenReaderToggled,
         );
         AccessibilityInfo.fetch().then((isEnabled) => {
           this.setState({
    @@ -55,7 +55,7 @@
       componentWillUnmount() {
         AccessibilityInfo.removeEventListener(
           'change',
    -      this._handleScreenReaderToggled
    +      this._handleScreenReaderToggled,
         );
       }
     
    diff --git a/docs/next/accessibilityinfo/index.html b/docs/next/accessibilityinfo/index.html
    index ba96563a229..4cf45047d12 100644
    --- a/docs/next/accessibilityinfo/index.html
    +++ b/docs/next/accessibilityinfo/index.html
    @@ -43,7 +43,7 @@
       componentDidMount() {
         AccessibilityInfo.addEventListener(
           'change',
    -      this._handleScreenReaderToggled
    +      this._handleScreenReaderToggled,
         );
         AccessibilityInfo.fetch().then((isEnabled) => {
           this.setState({
    @@ -55,7 +55,7 @@
       componentWillUnmount() {
         AccessibilityInfo.removeEventListener(
           'change',
    -      this._handleScreenReaderToggled
    +      this._handleScreenReaderToggled,
         );
       }
     
    diff --git a/docs/next/alertios.html b/docs/next/alertios.html
    index 29bd03164ac..869988ec1f2 100644
    --- a/docs/next/alertios.html
    +++ b/docs/next/alertios.html
    @@ -92,7 +92,7 @@
           text: 'Install',
           onPress: () => console.log('Install Pressed'),
         },
    -  ]
    +  ],
     );
     

    @@ -129,7 +129,7 @@ onPress: (password) => console.log('OK Pressed, password: ' + password), }, ], - 'secure-text' + 'secure-text', );

    ,

    @@ -139,7 +139,7 @@ null, (text) => console.log('Your username is ' + text), null, - 'default' + 'default', );

    Type Definitions

    diff --git a/docs/next/alertios/index.html b/docs/next/alertios/index.html index 29bd03164ac..869988ec1f2 100644 --- a/docs/next/alertios/index.html +++ b/docs/next/alertios/index.html @@ -92,7 +92,7 @@ text: 'Install', onPress: () => console.log('Install Pressed'), }, - ] + ], );
    @@ -129,7 +129,7 @@ onPress: (password) => console.log('OK Pressed, password: ' + password), }, ], - 'secure-text' + 'secure-text', );

    ,

    @@ -139,7 +139,7 @@ null, (text) => console.log('Your username is ' + text), null, - 'default' + 'default', );

    Type Definitions

    diff --git a/docs/next/animated.html b/docs/next/animated.html index 9e4fa688a47..a8e491dca12 100644 --- a/docs/next/animated.html +++ b/docs/next/animated.html @@ -40,7 +40,7 @@ this.state.fadeAnim, // The value to drive { toValue: 1, // Animate to final value of 1 - } + }, ).start(); // Start the animation

    Refer to the Animations guide to see additional examples of Animated in action.

    diff --git a/docs/next/animated/index.html b/docs/next/animated/index.html index 9e4fa688a47..a8e491dca12 100644 --- a/docs/next/animated/index.html +++ b/docs/next/animated/index.html @@ -40,7 +40,7 @@ this.state.fadeAnim, // The value to drive { toValue: 1, // Animate to final value of 1 - } + }, ).start(); // Start the animation

    Refer to the Animations guide to see additional examples of Animated in action.

    diff --git a/docs/next/animatedvaluexy.html b/docs/next/animatedvaluexy.html index a69675432e2..42512e19bea 100644 --- a/docs/next/animatedvaluexy.html +++ b/docs/next/animatedvaluexy.html @@ -27,7 +27,7 @@ onPanResponderRelease: () => { Animated.spring( this.state.pan, // Auto-multiplexed - {toValue: {x: 0, y: 0}} // Back to zero + {toValue: {x: 0, y: 0}}, // Back to zero ).start(); }, }); diff --git a/docs/next/animatedvaluexy/index.html b/docs/next/animatedvaluexy/index.html index a69675432e2..42512e19bea 100644 --- a/docs/next/animatedvaluexy/index.html +++ b/docs/next/animatedvaluexy/index.html @@ -27,7 +27,7 @@ onPanResponderRelease: () => { Animated.spring( this.state.pan, // Auto-multiplexed - {toValue: {x: 0, y: 0}} // Back to zero + {toValue: {x: 0, y: 0}}, // Back to zero ).start(); }, }); diff --git a/docs/next/animations.html b/docs/next/animations.html index 970877aabaa..0c13b0ebfd7 100644 --- a/docs/next/animations.html +++ b/docs/next/animations.html @@ -256,7 +256,7 @@ Animated.timing(opacity, { }, }, ], - {useNativeDriver: true} // <-- Add this + {useNativeDriver: true}, // <-- Add this )}> {content} </Animated.ScrollView> diff --git a/docs/next/animations/index.html b/docs/next/animations/index.html index 970877aabaa..0c13b0ebfd7 100644 --- a/docs/next/animations/index.html +++ b/docs/next/animations/index.html @@ -256,7 +256,7 @@ Animated.timing(opacity, { }, }, ], - {useNativeDriver: true} // <-- Add this + {useNativeDriver: true}, // <-- Add this )}> {content} </Animated.ScrollView> diff --git a/docs/next/custom-webview-android.html b/docs/next/custom-webview-android.html index 684410c45c5..ed7fb16f236 100644 --- a/docs/next/custom-webview-android.html +++ b/docs/next/custom-webview-android.html @@ -174,7 +174,7 @@ const RCTCustomWebView = requireNativeComponent( 'RCTCustomWebView', CustomWebView, - WebView.extraNativeComponentConfig + WebView.extraNativeComponentConfig, );

    If you want to add custom props to your native component, you can use nativeConfig.props on the web view.

    @@ -223,7 +223,7 @@ const RCTCustomWebView = requireNativeComponent( ...WebView.extraNativeComponentConfig.nativeOnly, onScrollToBottom: true, }, - } + }, );
    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    Edit

    Upgrading to new React Native versions

    Upgrading to new versions of React Native will give you access to more APIs, views, developer tools and other goodies. Upgrading requires a small amount of effort, but we try to make it easy for you. The instructions are a bit different depending on whether you used create-react-native-app or react-native init to create your project.

    -

    Create React Native App projects

    -

    Upgrading your Create React Native App project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this document to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    -

    See the CRNA user guide for up-to-date information about upgrading your project.

    +

    Expo projects

    +

    Upgrading your Expo project to a new version of React Native requires updating the react-native, react, and expo package versions in your package.json file. Please refer to this list to find out what versions are supported. You will also need to set the correct sdkVersion in your app.json file.

    +

    See the Upgrading Expo SDK Walkthrough for up-to-date information about upgrading your project.

    Projects built with native code

    Because React Native projects built with native code are essentially made up of an Android project, an iOS project, and a JavaScript project, upgrading can be rather tricky. Here's what you need to do to upgrade from an older version of React Native.

    @@ -67,6 +67,10 @@

    You may specify a React Native version by passing an argument: react-native-git-upgrade X.Y.Z

    +

    Upon completion, run the following command to find your corresponding git patch file.

    +
    $ ls $TMPDIR/react-native-git-upgrade
    +
    +

    To apply the git patch, run git apply <path to patch> inside your project folder.

    The templates are upgraded in a optimized way. You still may encounter conflicts but only where the Git 3-way merge have failed, depending on the version and how you modified your sources.

    4. Resolve the conflicts

    Conflicted files include delimiters which make very clear where the changes come from. For example:

    @@ -118,7 +122,7 @@ npm WARN peerDependencies The peer dependency react@~R included from react-nativ
  • If a file is different in your project than the template, you will be prompted; you have options to keep your file or overwrite it with the template version.
  • Manual Upgrades

    -

    Some upgrades require manual steps, e.g. 0.13 to 0.14, or 0.28 to 0.29. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.

    +

    Some upgrades require manual steps, e.g. 0.28 to 0.29, or 0.56 to 0.57. Be sure to check the release notes when upgrading so that you can identify any manual changes your particular project may require.