diff --git a/docs/0.10/getting-started.html b/docs/0.10/getting-started.html index c34db9c2697..6977f9d92d0 100644 --- a/docs/0.10/getting-started.html +++ b/docs/0.10/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo start
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.10/getting-started/index.html b/docs/0.10/getting-started/index.html index c34db9c2697..6977f9d92d0 100644 --- a/docs/0.10/getting-started/index.html +++ b/docs/0.10/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.10/integration-with-existing-apps.html b/docs/0.10/integration-with-existing-apps.html index 4005f21edb8..aa5b410170d 100644 --- a/docs/0.10/integration-with-existing-apps.html +++ b/docs/0.10/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.10/integration-with-existing-apps/index.html b/docs/0.10/integration-with-existing-apps/index.html index 4005f21edb8..aa5b410170d 100644 --- a/docs/0.10/integration-with-existing-apps/index.html +++ b/docs/0.10/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.10/javascript-environment.html b/docs/0.10/javascript-environment.html index 6f19ee71751..f40745384d5 100644 --- a/docs/0.10/javascript-environment.html +++ b/docs/0.10/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.10/javascript-environment/index.html b/docs/0.10/javascript-environment/index.html index 6f19ee71751..f40745384d5 100644 --- a/docs/0.10/javascript-environment/index.html +++ b/docs/0.10/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.10/native-components-ios.html b/docs/0.10/native-components-ios.html index efa817fe852..003169382e5 100644 --- a/docs/0.10/native-components-ios.html +++ b/docs/0.10/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.10/native-components-ios/index.html b/docs/0.10/native-components-ios/index.html index efa817fe852..003169382e5 100644 --- a/docs/0.10/native-components-ios/index.html +++ b/docs/0.10/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.10/native-modules-android.html b/docs/0.10/native-modules-android.html index be9d0137a8f..580bdabccda 100644 --- a/docs/0.10/native-modules-android.html +++ b/docs/0.10/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.10/native-modules-android/index.html b/docs/0.10/native-modules-android/index.html index be9d0137a8f..580bdabccda 100644 --- a/docs/0.10/native-modules-android/index.html +++ b/docs/0.10/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.10/native-modules-ios.html b/docs/0.10/native-modules-ios.html index 862c66be4fb..459243b1feb 100644 --- a/docs/0.10/native-modules-ios.html +++ b/docs/0.10/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.10/performance/index.html b/docs/0.10/performance/index.html index c9ed2b2b94a..3059ad8fadc 100644 --- a/docs/0.10/performance/index.html +++ b/docs/0.10/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.11/getting-started.html b/docs/0.11/getting-started.html index 8acea6cba95..273d6eb8742 100644 --- a/docs/0.11/getting-started.html +++ b/docs/0.11/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.11/getting-started/index.html b/docs/0.11/getting-started/index.html index 8acea6cba95..273d6eb8742 100644 --- a/docs/0.11/getting-started/index.html +++ b/docs/0.11/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.11/integration-with-existing-apps.html b/docs/0.11/integration-with-existing-apps.html index 2da2bd068d3..c7b635209b0 100644 --- a/docs/0.11/integration-with-existing-apps.html +++ b/docs/0.11/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.11/integration-with-existing-apps/index.html b/docs/0.11/integration-with-existing-apps/index.html index 2da2bd068d3..c7b635209b0 100644 --- a/docs/0.11/integration-with-existing-apps/index.html +++ b/docs/0.11/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.11/javascript-environment.html b/docs/0.11/javascript-environment.html index bac6a66e10c..0404a88abc6 100644 --- a/docs/0.11/javascript-environment.html +++ b/docs/0.11/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.11/javascript-environment/index.html b/docs/0.11/javascript-environment/index.html index bac6a66e10c..0404a88abc6 100644 --- a/docs/0.11/javascript-environment/index.html +++ b/docs/0.11/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.11/native-components-ios.html b/docs/0.11/native-components-ios.html index 2c7ca38dc6e..7ea27187d41 100644 --- a/docs/0.11/native-components-ios.html +++ b/docs/0.11/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.11/native-components-ios/index.html b/docs/0.11/native-components-ios/index.html index 2c7ca38dc6e..7ea27187d41 100644 --- a/docs/0.11/native-components-ios/index.html +++ b/docs/0.11/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.11/native-modules-android.html b/docs/0.11/native-modules-android.html index 26a1f384dd1..0053e569f03 100644 --- a/docs/0.11/native-modules-android.html +++ b/docs/0.11/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.11/native-modules-android/index.html b/docs/0.11/native-modules-android/index.html index 26a1f384dd1..0053e569f03 100644 --- a/docs/0.11/native-modules-android/index.html +++ b/docs/0.11/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.11/native-modules-ios.html b/docs/0.11/native-modules-ios.html index 3ef0e9ab719..632545c8ac1 100644 --- a/docs/0.11/native-modules-ios.html +++ b/docs/0.11/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.11/performance/index.html b/docs/0.11/performance/index.html index ce1aa7f4f58..52235574656 100644 --- a/docs/0.11/performance/index.html +++ b/docs/0.11/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.12/getting-started.html b/docs/0.12/getting-started.html index 6a0b45daf59..849daedad19 100644 --- a/docs/0.12/getting-started.html +++ b/docs/0.12/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.12/getting-started/index.html b/docs/0.12/getting-started/index.html index 6a0b45daf59..849daedad19 100644 --- a/docs/0.12/getting-started/index.html +++ b/docs/0.12/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.12/integration-with-existing-apps.html b/docs/0.12/integration-with-existing-apps.html index dce38dbb86e..d3699ebe67d 100644 --- a/docs/0.12/integration-with-existing-apps.html +++ b/docs/0.12/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.12/integration-with-existing-apps/index.html b/docs/0.12/integration-with-existing-apps/index.html index dce38dbb86e..d3699ebe67d 100644 --- a/docs/0.12/integration-with-existing-apps/index.html +++ b/docs/0.12/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.12/javascript-environment.html b/docs/0.12/javascript-environment.html index 3f1a68d10f9..c3797657907 100644 --- a/docs/0.12/javascript-environment.html +++ b/docs/0.12/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.12/javascript-environment/index.html b/docs/0.12/javascript-environment/index.html index 3f1a68d10f9..c3797657907 100644 --- a/docs/0.12/javascript-environment/index.html +++ b/docs/0.12/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.12/native-components-ios.html b/docs/0.12/native-components-ios.html index dd0bc8c7c82..f23eb945f6c 100644 --- a/docs/0.12/native-components-ios.html +++ b/docs/0.12/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.12/native-components-ios/index.html b/docs/0.12/native-components-ios/index.html index dd0bc8c7c82..f23eb945f6c 100644 --- a/docs/0.12/native-components-ios/index.html +++ b/docs/0.12/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.12/native-modules-android.html b/docs/0.12/native-modules-android.html index c855bf8c39b..7e488baf89a 100644 --- a/docs/0.12/native-modules-android.html +++ b/docs/0.12/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.12/native-modules-android/index.html b/docs/0.12/native-modules-android/index.html index c855bf8c39b..7e488baf89a 100644 --- a/docs/0.12/native-modules-android/index.html +++ b/docs/0.12/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.12/native-modules-ios.html b/docs/0.12/native-modules-ios.html index 02fbe5da52a..54ae07e9282 100644 --- a/docs/0.12/native-modules-ios.html +++ b/docs/0.12/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.12/performance/index.html b/docs/0.12/performance/index.html index f62bb2be9ca..10ce907c14a 100644 --- a/docs/0.12/performance/index.html +++ b/docs/0.12/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.13/getting-started.html b/docs/0.13/getting-started.html index 34b190e3935..b1370ae9c24 100644 --- a/docs/0.13/getting-started.html +++ b/docs/0.13/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.13/getting-started/index.html b/docs/0.13/getting-started/index.html index 34b190e3935..b1370ae9c24 100644 --- a/docs/0.13/getting-started/index.html +++ b/docs/0.13/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.13/integration-with-existing-apps.html b/docs/0.13/integration-with-existing-apps.html index 8a07742e878..d10744da199 100644 --- a/docs/0.13/integration-with-existing-apps.html +++ b/docs/0.13/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.13/integration-with-existing-apps/index.html b/docs/0.13/integration-with-existing-apps/index.html index 8a07742e878..d10744da199 100644 --- a/docs/0.13/integration-with-existing-apps/index.html +++ b/docs/0.13/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.13/javascript-environment.html b/docs/0.13/javascript-environment.html index e58ea596d2b..e8526e20cc2 100644 --- a/docs/0.13/javascript-environment.html +++ b/docs/0.13/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.13/javascript-environment/index.html b/docs/0.13/javascript-environment/index.html index e58ea596d2b..e8526e20cc2 100644 --- a/docs/0.13/javascript-environment/index.html +++ b/docs/0.13/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.13/native-components-ios.html b/docs/0.13/native-components-ios.html index 0883da3e65c..fb4dd69bb9a 100644 --- a/docs/0.13/native-components-ios.html +++ b/docs/0.13/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.13/native-components-ios/index.html b/docs/0.13/native-components-ios/index.html index 0883da3e65c..fb4dd69bb9a 100644 --- a/docs/0.13/native-components-ios/index.html +++ b/docs/0.13/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.13/native-modules-android.html b/docs/0.13/native-modules-android.html index 6854956c6b9..fbcd9f8bfea 100644 --- a/docs/0.13/native-modules-android.html +++ b/docs/0.13/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.13/native-modules-android/index.html b/docs/0.13/native-modules-android/index.html index 6854956c6b9..fbcd9f8bfea 100644 --- a/docs/0.13/native-modules-android/index.html +++ b/docs/0.13/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.13/native-modules-ios.html b/docs/0.13/native-modules-ios.html index 31dc56cc03b..ef4e7d3e6da 100644 --- a/docs/0.13/native-modules-ios.html +++ b/docs/0.13/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.13/performance/index.html b/docs/0.13/performance/index.html index 04f2689c0ba..1b64865e4a6 100644 --- a/docs/0.13/performance/index.html +++ b/docs/0.13/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.14/getting-started.html b/docs/0.14/getting-started.html index d8bd425162a..dbf333f6dd0 100644 --- a/docs/0.14/getting-started.html +++ b/docs/0.14/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.14/getting-started/index.html b/docs/0.14/getting-started/index.html index d8bd425162a..dbf333f6dd0 100644 --- a/docs/0.14/getting-started/index.html +++ b/docs/0.14/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.14/integration-with-existing-apps.html b/docs/0.14/integration-with-existing-apps.html index 697475a7205..158bdddb3f0 100644 --- a/docs/0.14/integration-with-existing-apps.html +++ b/docs/0.14/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.14/integration-with-existing-apps/index.html b/docs/0.14/integration-with-existing-apps/index.html index 697475a7205..158bdddb3f0 100644 --- a/docs/0.14/integration-with-existing-apps/index.html +++ b/docs/0.14/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.14/javascript-environment.html b/docs/0.14/javascript-environment.html index df4aa7c2baa..a4d72d66e4d 100644 --- a/docs/0.14/javascript-environment.html +++ b/docs/0.14/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.14/javascript-environment/index.html b/docs/0.14/javascript-environment/index.html index df4aa7c2baa..a4d72d66e4d 100644 --- a/docs/0.14/javascript-environment/index.html +++ b/docs/0.14/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.14/native-components-ios.html b/docs/0.14/native-components-ios.html index 59c634bde81..498f45ef16c 100644 --- a/docs/0.14/native-components-ios.html +++ b/docs/0.14/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.14/native-components-ios/index.html b/docs/0.14/native-components-ios/index.html index 59c634bde81..498f45ef16c 100644 --- a/docs/0.14/native-components-ios/index.html +++ b/docs/0.14/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.14/native-modules-android.html b/docs/0.14/native-modules-android.html index dde04f5b991..21b4ac72af7 100644 --- a/docs/0.14/native-modules-android.html +++ b/docs/0.14/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.14/native-modules-android/index.html b/docs/0.14/native-modules-android/index.html index dde04f5b991..21b4ac72af7 100644 --- a/docs/0.14/native-modules-android/index.html +++ b/docs/0.14/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.14/native-modules-ios.html b/docs/0.14/native-modules-ios.html index 58ddc684125..1069a402e99 100644 --- a/docs/0.14/native-modules-ios.html +++ b/docs/0.14/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.14/performance/index.html b/docs/0.14/performance/index.html index 1e60da9767a..c1f62d93889 100644 --- a/docs/0.14/performance/index.html +++ b/docs/0.14/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.15/getting-started.html b/docs/0.15/getting-started.html index fba658f5eb2..3c3e3e701d6 100644 --- a/docs/0.15/getting-started.html +++ b/docs/0.15/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.15/getting-started/index.html b/docs/0.15/getting-started/index.html index fba658f5eb2..3c3e3e701d6 100644 --- a/docs/0.15/getting-started/index.html +++ b/docs/0.15/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.15/integration-with-existing-apps.html b/docs/0.15/integration-with-existing-apps.html index c3862ffafa0..f5921b3f5e3 100644 --- a/docs/0.15/integration-with-existing-apps.html +++ b/docs/0.15/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.15/integration-with-existing-apps/index.html b/docs/0.15/integration-with-existing-apps/index.html index c3862ffafa0..f5921b3f5e3 100644 --- a/docs/0.15/integration-with-existing-apps/index.html +++ b/docs/0.15/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.15/javascript-environment.html b/docs/0.15/javascript-environment.html index 1cbbac3b1d4..c1419fdf9d6 100644 --- a/docs/0.15/javascript-environment.html +++ b/docs/0.15/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.15/javascript-environment/index.html b/docs/0.15/javascript-environment/index.html index 1cbbac3b1d4..c1419fdf9d6 100644 --- a/docs/0.15/javascript-environment/index.html +++ b/docs/0.15/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.15/native-components-ios.html b/docs/0.15/native-components-ios.html index 549f8826ead..4c7e8d2f8a8 100644 --- a/docs/0.15/native-components-ios.html +++ b/docs/0.15/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.15/native-components-ios/index.html b/docs/0.15/native-components-ios/index.html index 549f8826ead..4c7e8d2f8a8 100644 --- a/docs/0.15/native-components-ios/index.html +++ b/docs/0.15/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.15/native-modules-android.html b/docs/0.15/native-modules-android.html index 757aa334ab1..64bc86fc7f3 100644 --- a/docs/0.15/native-modules-android.html +++ b/docs/0.15/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.15/native-modules-android/index.html b/docs/0.15/native-modules-android/index.html index 757aa334ab1..64bc86fc7f3 100644 --- a/docs/0.15/native-modules-android/index.html +++ b/docs/0.15/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.15/native-modules-ios.html b/docs/0.15/native-modules-ios.html index 849f9863111..086c3844558 100644 --- a/docs/0.15/native-modules-ios.html +++ b/docs/0.15/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.15/performance/index.html b/docs/0.15/performance/index.html index 6c013714bb4..b8e8bf29ee3 100644 --- a/docs/0.15/performance/index.html +++ b/docs/0.15/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.16/getting-started.html b/docs/0.16/getting-started.html index 5cdae2116f7..451da44c0f9 100644 --- a/docs/0.16/getting-started.html +++ b/docs/0.16/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.16/getting-started/index.html b/docs/0.16/getting-started/index.html index 5cdae2116f7..451da44c0f9 100644 --- a/docs/0.16/getting-started/index.html +++ b/docs/0.16/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.16/integration-with-existing-apps.html b/docs/0.16/integration-with-existing-apps.html index 9010f2d9af2..1c36d05f016 100644 --- a/docs/0.16/integration-with-existing-apps.html +++ b/docs/0.16/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.16/integration-with-existing-apps/index.html b/docs/0.16/integration-with-existing-apps/index.html index 9010f2d9af2..1c36d05f016 100644 --- a/docs/0.16/integration-with-existing-apps/index.html +++ b/docs/0.16/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.16/javascript-environment.html b/docs/0.16/javascript-environment.html index dab1aa2a404..cb78b443478 100644 --- a/docs/0.16/javascript-environment.html +++ b/docs/0.16/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.16/javascript-environment/index.html b/docs/0.16/javascript-environment/index.html index dab1aa2a404..cb78b443478 100644 --- a/docs/0.16/javascript-environment/index.html +++ b/docs/0.16/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.16/native-components-ios.html b/docs/0.16/native-components-ios.html index 668fa33367d..f29618b56a9 100644 --- a/docs/0.16/native-components-ios.html +++ b/docs/0.16/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.16/native-components-ios/index.html b/docs/0.16/native-components-ios/index.html index 668fa33367d..f29618b56a9 100644 --- a/docs/0.16/native-components-ios/index.html +++ b/docs/0.16/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.16/native-modules-android.html b/docs/0.16/native-modules-android.html index dadcfcd29a7..a3b42e240ce 100644 --- a/docs/0.16/native-modules-android.html +++ b/docs/0.16/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.16/native-modules-android/index.html b/docs/0.16/native-modules-android/index.html index dadcfcd29a7..a3b42e240ce 100644 --- a/docs/0.16/native-modules-android/index.html +++ b/docs/0.16/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.16/native-modules-ios.html b/docs/0.16/native-modules-ios.html index f81e8cb7647..80758e707d3 100644 --- a/docs/0.16/native-modules-ios.html +++ b/docs/0.16/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.16/performance/index.html b/docs/0.16/performance/index.html index 4756ad9b822..61c57d2920e 100644 --- a/docs/0.16/performance/index.html +++ b/docs/0.16/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.17/getting-started.html b/docs/0.17/getting-started.html index 2282d786c5c..97837de6bea 100644 --- a/docs/0.17/getting-started.html +++ b/docs/0.17/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.17/getting-started/index.html b/docs/0.17/getting-started/index.html index 2282d786c5c..97837de6bea 100644 --- a/docs/0.17/getting-started/index.html +++ b/docs/0.17/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.17/integration-with-existing-apps.html b/docs/0.17/integration-with-existing-apps.html index edf1ee97788..dcfb420887e 100644 --- a/docs/0.17/integration-with-existing-apps.html +++ b/docs/0.17/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.17/integration-with-existing-apps/index.html b/docs/0.17/integration-with-existing-apps/index.html index edf1ee97788..dcfb420887e 100644 --- a/docs/0.17/integration-with-existing-apps/index.html +++ b/docs/0.17/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.17/javascript-environment.html b/docs/0.17/javascript-environment.html index b431f3c899e..900dbf41945 100644 --- a/docs/0.17/javascript-environment.html +++ b/docs/0.17/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.17/javascript-environment/index.html b/docs/0.17/javascript-environment/index.html index b431f3c899e..900dbf41945 100644 --- a/docs/0.17/javascript-environment/index.html +++ b/docs/0.17/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.17/native-components-ios.html b/docs/0.17/native-components-ios.html index 68b45ad0f48..296c726719c 100644 --- a/docs/0.17/native-components-ios.html +++ b/docs/0.17/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.17/native-components-ios/index.html b/docs/0.17/native-components-ios/index.html index 68b45ad0f48..296c726719c 100644 --- a/docs/0.17/native-components-ios/index.html +++ b/docs/0.17/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.17/native-modules-android.html b/docs/0.17/native-modules-android.html index 8e1cc3918da..b277111ada5 100644 --- a/docs/0.17/native-modules-android.html +++ b/docs/0.17/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.17/native-modules-android/index.html b/docs/0.17/native-modules-android/index.html index 8e1cc3918da..b277111ada5 100644 --- a/docs/0.17/native-modules-android/index.html +++ b/docs/0.17/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.17/native-modules-ios.html b/docs/0.17/native-modules-ios.html index 11dc0731275..295e200492d 100644 --- a/docs/0.17/native-modules-ios.html +++ b/docs/0.17/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.17/performance/index.html b/docs/0.17/performance/index.html index 30e8acfccf8..a5db2799303 100644 --- a/docs/0.17/performance/index.html +++ b/docs/0.17/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.18/getting-started.html b/docs/0.18/getting-started.html index 4758eef796a..af1ce79569e 100644 --- a/docs/0.18/getting-started.html +++ b/docs/0.18/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.18/getting-started/index.html b/docs/0.18/getting-started/index.html index 4758eef796a..af1ce79569e 100644 --- a/docs/0.18/getting-started/index.html +++ b/docs/0.18/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.18/integration-with-existing-apps.html b/docs/0.18/integration-with-existing-apps.html index b2f6a6f16e9..1139d5e0b0d 100644 --- a/docs/0.18/integration-with-existing-apps.html +++ b/docs/0.18/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.18/integration-with-existing-apps/index.html b/docs/0.18/integration-with-existing-apps/index.html index b2f6a6f16e9..1139d5e0b0d 100644 --- a/docs/0.18/integration-with-existing-apps/index.html +++ b/docs/0.18/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.18/javascript-environment.html b/docs/0.18/javascript-environment.html index a9af5f08da4..a9d3cd8a4d4 100644 --- a/docs/0.18/javascript-environment.html +++ b/docs/0.18/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.18/javascript-environment/index.html b/docs/0.18/javascript-environment/index.html index a9af5f08da4..a9d3cd8a4d4 100644 --- a/docs/0.18/javascript-environment/index.html +++ b/docs/0.18/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.18/native-components-ios.html b/docs/0.18/native-components-ios.html index 3700c1c4ac0..491a921b3b2 100644 --- a/docs/0.18/native-components-ios.html +++ b/docs/0.18/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.18/native-components-ios/index.html b/docs/0.18/native-components-ios/index.html index 3700c1c4ac0..491a921b3b2 100644 --- a/docs/0.18/native-components-ios/index.html +++ b/docs/0.18/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.18/native-modules-android.html b/docs/0.18/native-modules-android.html index 63fdfbec460..7ff0e145669 100644 --- a/docs/0.18/native-modules-android.html +++ b/docs/0.18/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.18/native-modules-android/index.html b/docs/0.18/native-modules-android/index.html index 63fdfbec460..7ff0e145669 100644 --- a/docs/0.18/native-modules-android/index.html +++ b/docs/0.18/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.18/native-modules-ios.html b/docs/0.18/native-modules-ios.html index 7bf7760ce2c..3fef17c0ba6 100644 --- a/docs/0.18/native-modules-ios.html +++ b/docs/0.18/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.18/performance/index.html b/docs/0.18/performance/index.html index b206a3a7f50..4be1dbd7a26 100644 --- a/docs/0.18/performance/index.html +++ b/docs/0.18/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.19/getting-started.html b/docs/0.19/getting-started.html index 14d96cb913a..9ad8ae9638d 100644 --- a/docs/0.19/getting-started.html +++ b/docs/0.19/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.19/getting-started/index.html b/docs/0.19/getting-started/index.html index 14d96cb913a..9ad8ae9638d 100644 --- a/docs/0.19/getting-started/index.html +++ b/docs/0.19/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.19/integration-with-existing-apps.html b/docs/0.19/integration-with-existing-apps.html index d2fc2b6eb18..b83aed26bc0 100644 --- a/docs/0.19/integration-with-existing-apps.html +++ b/docs/0.19/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.19/integration-with-existing-apps/index.html b/docs/0.19/integration-with-existing-apps/index.html index d2fc2b6eb18..b83aed26bc0 100644 --- a/docs/0.19/integration-with-existing-apps/index.html +++ b/docs/0.19/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.19/javascript-environment.html b/docs/0.19/javascript-environment.html index baf7584bd3a..63db4830f9c 100644 --- a/docs/0.19/javascript-environment.html +++ b/docs/0.19/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.19/javascript-environment/index.html b/docs/0.19/javascript-environment/index.html index baf7584bd3a..63db4830f9c 100644 --- a/docs/0.19/javascript-environment/index.html +++ b/docs/0.19/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.19/native-components-ios.html b/docs/0.19/native-components-ios.html index 3d8cc9857ea..cb3aac7c2aa 100644 --- a/docs/0.19/native-components-ios.html +++ b/docs/0.19/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.19/native-components-ios/index.html b/docs/0.19/native-components-ios/index.html index 3d8cc9857ea..cb3aac7c2aa 100644 --- a/docs/0.19/native-components-ios/index.html +++ b/docs/0.19/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.19/native-modules-android.html b/docs/0.19/native-modules-android.html index 055afd8ade4..74db61e244f 100644 --- a/docs/0.19/native-modules-android.html +++ b/docs/0.19/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.19/native-modules-android/index.html b/docs/0.19/native-modules-android/index.html index 055afd8ade4..74db61e244f 100644 --- a/docs/0.19/native-modules-android/index.html +++ b/docs/0.19/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.19/native-modules-ios.html b/docs/0.19/native-modules-ios.html index 5a9e73730f4..8fbb7d395a8 100644 --- a/docs/0.19/native-modules-ios.html +++ b/docs/0.19/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.19/performance/index.html b/docs/0.19/performance/index.html index 5b5d7e081e2..bf9e31af204 100644 --- a/docs/0.19/performance/index.html +++ b/docs/0.19/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.20/getting-started.html b/docs/0.20/getting-started.html index 40686dbda63..8f074749ce6 100644 --- a/docs/0.20/getting-started.html +++ b/docs/0.20/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.20/getting-started/index.html b/docs/0.20/getting-started/index.html index 40686dbda63..8f074749ce6 100644 --- a/docs/0.20/getting-started/index.html +++ b/docs/0.20/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.20/integration-with-existing-apps.html b/docs/0.20/integration-with-existing-apps.html index de9e583e3a8..57835de6d35 100644 --- a/docs/0.20/integration-with-existing-apps.html +++ b/docs/0.20/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.20/integration-with-existing-apps/index.html b/docs/0.20/integration-with-existing-apps/index.html index de9e583e3a8..57835de6d35 100644 --- a/docs/0.20/integration-with-existing-apps/index.html +++ b/docs/0.20/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.20/javascript-environment.html b/docs/0.20/javascript-environment.html index 02b2f42e9cc..e60d70e8951 100644 --- a/docs/0.20/javascript-environment.html +++ b/docs/0.20/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.20/javascript-environment/index.html b/docs/0.20/javascript-environment/index.html index 02b2f42e9cc..e60d70e8951 100644 --- a/docs/0.20/javascript-environment/index.html +++ b/docs/0.20/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.20/native-components-ios.html b/docs/0.20/native-components-ios.html index 796c3557b1a..cd997c674f2 100644 --- a/docs/0.20/native-components-ios.html +++ b/docs/0.20/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.20/native-components-ios/index.html b/docs/0.20/native-components-ios/index.html index 796c3557b1a..cd997c674f2 100644 --- a/docs/0.20/native-components-ios/index.html +++ b/docs/0.20/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.20/native-modules-android.html b/docs/0.20/native-modules-android.html index 724a2d236cb..c406c300988 100644 --- a/docs/0.20/native-modules-android.html +++ b/docs/0.20/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.20/native-modules-android/index.html b/docs/0.20/native-modules-android/index.html index 724a2d236cb..c406c300988 100644 --- a/docs/0.20/native-modules-android/index.html +++ b/docs/0.20/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.20/native-modules-ios.html b/docs/0.20/native-modules-ios.html index 8b5e8d0596a..eda970cb15d 100644 --- a/docs/0.20/native-modules-ios.html +++ b/docs/0.20/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.20/performance/index.html b/docs/0.20/performance/index.html index 1ab815db712..9628f7d114f 100644 --- a/docs/0.20/performance/index.html +++ b/docs/0.20/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.21/getting-started.html b/docs/0.21/getting-started.html index f36a8a63d84..8fec099d0f2 100644 --- a/docs/0.21/getting-started.html +++ b/docs/0.21/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.21/getting-started/index.html b/docs/0.21/getting-started/index.html index f36a8a63d84..8fec099d0f2 100644 --- a/docs/0.21/getting-started/index.html +++ b/docs/0.21/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.21/integration-with-existing-apps.html b/docs/0.21/integration-with-existing-apps.html index d171c8200ff..f4253595503 100644 --- a/docs/0.21/integration-with-existing-apps.html +++ b/docs/0.21/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.21/integration-with-existing-apps/index.html b/docs/0.21/integration-with-existing-apps/index.html index d171c8200ff..f4253595503 100644 --- a/docs/0.21/integration-with-existing-apps/index.html +++ b/docs/0.21/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.21/javascript-environment.html b/docs/0.21/javascript-environment.html index a14472c1c89..daa8acb4dcb 100644 --- a/docs/0.21/javascript-environment.html +++ b/docs/0.21/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.21/javascript-environment/index.html b/docs/0.21/javascript-environment/index.html index a14472c1c89..daa8acb4dcb 100644 --- a/docs/0.21/javascript-environment/index.html +++ b/docs/0.21/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.21/native-components-ios.html b/docs/0.21/native-components-ios.html index 93c8110c3e3..b8544ded4ac 100644 --- a/docs/0.21/native-components-ios.html +++ b/docs/0.21/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.21/native-components-ios/index.html b/docs/0.21/native-components-ios/index.html index 93c8110c3e3..b8544ded4ac 100644 --- a/docs/0.21/native-components-ios/index.html +++ b/docs/0.21/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.21/native-modules-android.html b/docs/0.21/native-modules-android.html index 4a047341a6e..0b2e8580e27 100644 --- a/docs/0.21/native-modules-android.html +++ b/docs/0.21/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.21/native-modules-android/index.html b/docs/0.21/native-modules-android/index.html index 4a047341a6e..0b2e8580e27 100644 --- a/docs/0.21/native-modules-android/index.html +++ b/docs/0.21/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.21/native-modules-ios.html b/docs/0.21/native-modules-ios.html index dd28a686008..b249ccf5a96 100644 --- a/docs/0.21/native-modules-ios.html +++ b/docs/0.21/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.21/performance/index.html b/docs/0.21/performance/index.html index dcac3a11e4f..ea7865a55d9 100644 --- a/docs/0.21/performance/index.html +++ b/docs/0.21/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.22/getting-started.html b/docs/0.22/getting-started.html index 4637c5491bb..577d4218540 100644 --- a/docs/0.22/getting-started.html +++ b/docs/0.22/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.22/getting-started/index.html b/docs/0.22/getting-started/index.html index 4637c5491bb..577d4218540 100644 --- a/docs/0.22/getting-started/index.html +++ b/docs/0.22/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.22/integration-with-existing-apps.html b/docs/0.22/integration-with-existing-apps.html index 0712c0e755f..15d7270d65c 100644 --- a/docs/0.22/integration-with-existing-apps.html +++ b/docs/0.22/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.22/integration-with-existing-apps/index.html b/docs/0.22/integration-with-existing-apps/index.html index 0712c0e755f..15d7270d65c 100644 --- a/docs/0.22/integration-with-existing-apps/index.html +++ b/docs/0.22/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.22/javascript-environment.html b/docs/0.22/javascript-environment.html index e8eb46c8724..fda2f5a95eb 100644 --- a/docs/0.22/javascript-environment.html +++ b/docs/0.22/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.22/javascript-environment/index.html b/docs/0.22/javascript-environment/index.html index e8eb46c8724..fda2f5a95eb 100644 --- a/docs/0.22/javascript-environment/index.html +++ b/docs/0.22/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.22/native-components-ios.html b/docs/0.22/native-components-ios.html index cfb5657ebc9..a4c86d51e0b 100644 --- a/docs/0.22/native-components-ios.html +++ b/docs/0.22/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.22/native-components-ios/index.html b/docs/0.22/native-components-ios/index.html index cfb5657ebc9..a4c86d51e0b 100644 --- a/docs/0.22/native-components-ios/index.html +++ b/docs/0.22/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.22/native-modules-android.html b/docs/0.22/native-modules-android.html index 8b3468a82ea..436a12c3d90 100644 --- a/docs/0.22/native-modules-android.html +++ b/docs/0.22/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.22/native-modules-android/index.html b/docs/0.22/native-modules-android/index.html index 8b3468a82ea..436a12c3d90 100644 --- a/docs/0.22/native-modules-android/index.html +++ b/docs/0.22/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.22/native-modules-ios.html b/docs/0.22/native-modules-ios.html index d80f0327d83..5feb5a4ac18 100644 --- a/docs/0.22/native-modules-ios.html +++ b/docs/0.22/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.22/performance/index.html b/docs/0.22/performance/index.html index df65b7e6c16..da058b1595f 100644 --- a/docs/0.22/performance/index.html +++ b/docs/0.22/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.23/getting-started.html b/docs/0.23/getting-started.html index 0594a7f8101..25f234f62df 100644 --- a/docs/0.23/getting-started.html +++ b/docs/0.23/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.23/getting-started/index.html b/docs/0.23/getting-started/index.html index 0594a7f8101..25f234f62df 100644 --- a/docs/0.23/getting-started/index.html +++ b/docs/0.23/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.23/integration-with-existing-apps.html b/docs/0.23/integration-with-existing-apps.html index c51ad7bd956..72f338c6683 100644 --- a/docs/0.23/integration-with-existing-apps.html +++ b/docs/0.23/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.23/integration-with-existing-apps/index.html b/docs/0.23/integration-with-existing-apps/index.html index c51ad7bd956..72f338c6683 100644 --- a/docs/0.23/integration-with-existing-apps/index.html +++ b/docs/0.23/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.23/javascript-environment.html b/docs/0.23/javascript-environment.html index 023a8f67393..843baeb93e4 100644 --- a/docs/0.23/javascript-environment.html +++ b/docs/0.23/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.23/javascript-environment/index.html b/docs/0.23/javascript-environment/index.html index 023a8f67393..843baeb93e4 100644 --- a/docs/0.23/javascript-environment/index.html +++ b/docs/0.23/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.23/native-components-ios.html b/docs/0.23/native-components-ios.html index f640c56e083..85f410c86f6 100644 --- a/docs/0.23/native-components-ios.html +++ b/docs/0.23/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.23/native-components-ios/index.html b/docs/0.23/native-components-ios/index.html index f640c56e083..85f410c86f6 100644 --- a/docs/0.23/native-components-ios/index.html +++ b/docs/0.23/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.23/native-modules-android.html b/docs/0.23/native-modules-android.html index 018cbed5e6d..cae731943be 100644 --- a/docs/0.23/native-modules-android.html +++ b/docs/0.23/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.23/native-modules-android/index.html b/docs/0.23/native-modules-android/index.html index 018cbed5e6d..cae731943be 100644 --- a/docs/0.23/native-modules-android/index.html +++ b/docs/0.23/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.23/native-modules-ios.html b/docs/0.23/native-modules-ios.html index b259e1644c3..0214dc468e6 100644 --- a/docs/0.23/native-modules-ios.html +++ b/docs/0.23/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.23/performance/index.html b/docs/0.23/performance/index.html index d2dc8a86771..bfe41b74c2a 100644 --- a/docs/0.23/performance/index.html +++ b/docs/0.23/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.24/getting-started.html b/docs/0.24/getting-started.html index 6e58245f783..1e8d09ac2a9 100644 --- a/docs/0.24/getting-started.html +++ b/docs/0.24/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.24/getting-started/index.html b/docs/0.24/getting-started/index.html index 6e58245f783..1e8d09ac2a9 100644 --- a/docs/0.24/getting-started/index.html +++ b/docs/0.24/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.24/integration-with-existing-apps.html b/docs/0.24/integration-with-existing-apps.html index d7384099142..a1791dc4d7c 100644 --- a/docs/0.24/integration-with-existing-apps.html +++ b/docs/0.24/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.24/integration-with-existing-apps/index.html b/docs/0.24/integration-with-existing-apps/index.html index d7384099142..a1791dc4d7c 100644 --- a/docs/0.24/integration-with-existing-apps/index.html +++ b/docs/0.24/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.24/javascript-environment.html b/docs/0.24/javascript-environment.html index 42134aab254..5937e0369a4 100644 --- a/docs/0.24/javascript-environment.html +++ b/docs/0.24/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.24/javascript-environment/index.html b/docs/0.24/javascript-environment/index.html index 42134aab254..5937e0369a4 100644 --- a/docs/0.24/javascript-environment/index.html +++ b/docs/0.24/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.24/native-components-ios.html b/docs/0.24/native-components-ios.html index dce534d3d34..3b1e913f7ba 100644 --- a/docs/0.24/native-components-ios.html +++ b/docs/0.24/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.24/native-components-ios/index.html b/docs/0.24/native-components-ios/index.html index dce534d3d34..3b1e913f7ba 100644 --- a/docs/0.24/native-components-ios/index.html +++ b/docs/0.24/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.24/native-modules-android.html b/docs/0.24/native-modules-android.html index 5d4e1a3e1f6..2ae0c2393a8 100644 --- a/docs/0.24/native-modules-android.html +++ b/docs/0.24/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.24/native-modules-android/index.html b/docs/0.24/native-modules-android/index.html index 5d4e1a3e1f6..2ae0c2393a8 100644 --- a/docs/0.24/native-modules-android/index.html +++ b/docs/0.24/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.24/native-modules-ios.html b/docs/0.24/native-modules-ios.html index 1fc8dca32a7..8f5d0742772 100644 --- a/docs/0.24/native-modules-ios.html +++ b/docs/0.24/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.24/performance/index.html b/docs/0.24/performance/index.html index 59caf4e8ddf..3177ea570c2 100644 --- a/docs/0.24/performance/index.html +++ b/docs/0.24/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.25/getting-started.html b/docs/0.25/getting-started.html index 8326e2fff6e..3ef609cdad9 100644 --- a/docs/0.25/getting-started.html +++ b/docs/0.25/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.25/getting-started/index.html b/docs/0.25/getting-started/index.html index 8326e2fff6e..3ef609cdad9 100644 --- a/docs/0.25/getting-started/index.html +++ b/docs/0.25/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.25/integration-with-existing-apps.html b/docs/0.25/integration-with-existing-apps.html index c3a49f5e1e1..856441cc77f 100644 --- a/docs/0.25/integration-with-existing-apps.html +++ b/docs/0.25/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.25/integration-with-existing-apps/index.html b/docs/0.25/integration-with-existing-apps/index.html index c3a49f5e1e1..856441cc77f 100644 --- a/docs/0.25/integration-with-existing-apps/index.html +++ b/docs/0.25/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.25/javascript-environment.html b/docs/0.25/javascript-environment.html index 1000831c7cb..4a224c900b8 100644 --- a/docs/0.25/javascript-environment.html +++ b/docs/0.25/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.25/javascript-environment/index.html b/docs/0.25/javascript-environment/index.html index 1000831c7cb..4a224c900b8 100644 --- a/docs/0.25/javascript-environment/index.html +++ b/docs/0.25/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.25/native-components-ios.html b/docs/0.25/native-components-ios.html index de7f43f44d6..745562df399 100644 --- a/docs/0.25/native-components-ios.html +++ b/docs/0.25/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.25/native-components-ios/index.html b/docs/0.25/native-components-ios/index.html index de7f43f44d6..745562df399 100644 --- a/docs/0.25/native-components-ios/index.html +++ b/docs/0.25/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.25/native-modules-android.html b/docs/0.25/native-modules-android.html index b7d59076a69..3838ddd72a4 100644 --- a/docs/0.25/native-modules-android.html +++ b/docs/0.25/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.25/native-modules-android/index.html b/docs/0.25/native-modules-android/index.html index b7d59076a69..3838ddd72a4 100644 --- a/docs/0.25/native-modules-android/index.html +++ b/docs/0.25/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.25/native-modules-ios.html b/docs/0.25/native-modules-ios.html index 80a5743855d..81139af7d54 100644 --- a/docs/0.25/native-modules-ios.html +++ b/docs/0.25/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.25/performance/index.html b/docs/0.25/performance/index.html index 02574b49c2c..b2690b93ed6 100644 --- a/docs/0.25/performance/index.html +++ b/docs/0.25/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.26/getting-started.html b/docs/0.26/getting-started.html index 310457a4d8f..25b9c5d2794 100644 --- a/docs/0.26/getting-started.html +++ b/docs/0.26/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.26/getting-started/index.html b/docs/0.26/getting-started/index.html index 310457a4d8f..25b9c5d2794 100644 --- a/docs/0.26/getting-started/index.html +++ b/docs/0.26/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.26/integration-with-existing-apps.html b/docs/0.26/integration-with-existing-apps.html index 7f1d58ac82c..f3512ef76d0 100644 --- a/docs/0.26/integration-with-existing-apps.html +++ b/docs/0.26/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.26/integration-with-existing-apps/index.html b/docs/0.26/integration-with-existing-apps/index.html index 7f1d58ac82c..f3512ef76d0 100644 --- a/docs/0.26/integration-with-existing-apps/index.html +++ b/docs/0.26/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.26/javascript-environment.html b/docs/0.26/javascript-environment.html index 221b7f6927e..90c2a13972e 100644 --- a/docs/0.26/javascript-environment.html +++ b/docs/0.26/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.26/javascript-environment/index.html b/docs/0.26/javascript-environment/index.html index 221b7f6927e..90c2a13972e 100644 --- a/docs/0.26/javascript-environment/index.html +++ b/docs/0.26/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.26/native-components-ios.html b/docs/0.26/native-components-ios.html index 081c0c1a261..a35d39a422a 100644 --- a/docs/0.26/native-components-ios.html +++ b/docs/0.26/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.26/native-components-ios/index.html b/docs/0.26/native-components-ios/index.html index 081c0c1a261..a35d39a422a 100644 --- a/docs/0.26/native-components-ios/index.html +++ b/docs/0.26/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.26/native-modules-android.html b/docs/0.26/native-modules-android.html index ac391f87628..9dcf4bb4207 100644 --- a/docs/0.26/native-modules-android.html +++ b/docs/0.26/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.26/native-modules-android/index.html b/docs/0.26/native-modules-android/index.html index ac391f87628..9dcf4bb4207 100644 --- a/docs/0.26/native-modules-android/index.html +++ b/docs/0.26/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.26/native-modules-ios.html b/docs/0.26/native-modules-ios.html index acf6f4ef892..5f21de6b3b1 100644 --- a/docs/0.26/native-modules-ios.html +++ b/docs/0.26/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.26/performance/index.html b/docs/0.26/performance/index.html index a59f3a485e0..055ce309d9b 100644 --- a/docs/0.26/performance/index.html +++ b/docs/0.26/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.27/getting-started.html b/docs/0.27/getting-started.html index d92d7f3b130..21e3d1ea4ad 100644 --- a/docs/0.27/getting-started.html +++ b/docs/0.27/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.27/getting-started/index.html b/docs/0.27/getting-started/index.html index d92d7f3b130..21e3d1ea4ad 100644 --- a/docs/0.27/getting-started/index.html +++ b/docs/0.27/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.27/integration-with-existing-apps.html b/docs/0.27/integration-with-existing-apps.html index 0adb64d813a..34421367e2c 100644 --- a/docs/0.27/integration-with-existing-apps.html +++ b/docs/0.27/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.27/integration-with-existing-apps/index.html b/docs/0.27/integration-with-existing-apps/index.html index 0adb64d813a..34421367e2c 100644 --- a/docs/0.27/integration-with-existing-apps/index.html +++ b/docs/0.27/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.27/javascript-environment.html b/docs/0.27/javascript-environment.html index 74e69b7a9b0..976af6cc7ce 100644 --- a/docs/0.27/javascript-environment.html +++ b/docs/0.27/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.27/javascript-environment/index.html b/docs/0.27/javascript-environment/index.html index 74e69b7a9b0..976af6cc7ce 100644 --- a/docs/0.27/javascript-environment/index.html +++ b/docs/0.27/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.27/native-components-ios.html b/docs/0.27/native-components-ios.html index 5872a6abfcd..c263b0a6506 100644 --- a/docs/0.27/native-components-ios.html +++ b/docs/0.27/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.27/native-components-ios/index.html b/docs/0.27/native-components-ios/index.html index 5872a6abfcd..c263b0a6506 100644 --- a/docs/0.27/native-components-ios/index.html +++ b/docs/0.27/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.27/native-modules-android.html b/docs/0.27/native-modules-android.html index 9942757a35a..358063dfecd 100644 --- a/docs/0.27/native-modules-android.html +++ b/docs/0.27/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.27/native-modules-android/index.html b/docs/0.27/native-modules-android/index.html index 9942757a35a..358063dfecd 100644 --- a/docs/0.27/native-modules-android/index.html +++ b/docs/0.27/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.27/native-modules-ios.html b/docs/0.27/native-modules-ios.html index 921459253ff..4eb0076ba68 100644 --- a/docs/0.27/native-modules-ios.html +++ b/docs/0.27/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.27/performance/index.html b/docs/0.27/performance/index.html index abdb627c0dc..ad861cb279f 100644 --- a/docs/0.27/performance/index.html +++ b/docs/0.27/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.28/getting-started.html b/docs/0.28/getting-started.html index 08fe62bcfd5..7a44aabde97 100644 --- a/docs/0.28/getting-started.html +++ b/docs/0.28/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.28/getting-started/index.html b/docs/0.28/getting-started/index.html index 08fe62bcfd5..7a44aabde97 100644 --- a/docs/0.28/getting-started/index.html +++ b/docs/0.28/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.28/integration-with-existing-apps.html b/docs/0.28/integration-with-existing-apps.html index 0b90f02ed73..ba40c1c2c3a 100644 --- a/docs/0.28/integration-with-existing-apps.html +++ b/docs/0.28/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.28/integration-with-existing-apps/index.html b/docs/0.28/integration-with-existing-apps/index.html index 0b90f02ed73..ba40c1c2c3a 100644 --- a/docs/0.28/integration-with-existing-apps/index.html +++ b/docs/0.28/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.28/javascript-environment.html b/docs/0.28/javascript-environment.html index 2581ddec786..80237425bc0 100644 --- a/docs/0.28/javascript-environment.html +++ b/docs/0.28/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.28/javascript-environment/index.html b/docs/0.28/javascript-environment/index.html index 2581ddec786..80237425bc0 100644 --- a/docs/0.28/javascript-environment/index.html +++ b/docs/0.28/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.28/native-components-ios.html b/docs/0.28/native-components-ios.html index a6b35d6c771..b74b22b9790 100644 --- a/docs/0.28/native-components-ios.html +++ b/docs/0.28/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.28/native-components-ios/index.html b/docs/0.28/native-components-ios/index.html index a6b35d6c771..b74b22b9790 100644 --- a/docs/0.28/native-components-ios/index.html +++ b/docs/0.28/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.28/native-modules-android.html b/docs/0.28/native-modules-android.html index b6b21d92056..5061240eeae 100644 --- a/docs/0.28/native-modules-android.html +++ b/docs/0.28/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.28/native-modules-android/index.html b/docs/0.28/native-modules-android/index.html index b6b21d92056..5061240eeae 100644 --- a/docs/0.28/native-modules-android/index.html +++ b/docs/0.28/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.28/native-modules-ios.html b/docs/0.28/native-modules-ios.html index bb2bf643d6f..3afd8a273db 100644 --- a/docs/0.28/native-modules-ios.html +++ b/docs/0.28/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.28/performance/index.html b/docs/0.28/performance/index.html index c40a4b92659..c39e6489271 100644 --- a/docs/0.28/performance/index.html +++ b/docs/0.28/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.29/getting-started.html b/docs/0.29/getting-started.html index 58e8a0a87b2..58b7b1ed67b 100644 --- a/docs/0.29/getting-started.html +++ b/docs/0.29/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.29/getting-started/index.html b/docs/0.29/getting-started/index.html index 58e8a0a87b2..58b7b1ed67b 100644 --- a/docs/0.29/getting-started/index.html +++ b/docs/0.29/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.29/integration-with-existing-apps.html b/docs/0.29/integration-with-existing-apps.html index 3621e72bfed..5d6a5d9ba44 100644 --- a/docs/0.29/integration-with-existing-apps.html +++ b/docs/0.29/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.29/integration-with-existing-apps/index.html b/docs/0.29/integration-with-existing-apps/index.html index 3621e72bfed..5d6a5d9ba44 100644 --- a/docs/0.29/integration-with-existing-apps/index.html +++ b/docs/0.29/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.29/javascript-environment.html b/docs/0.29/javascript-environment.html index 5e1e12d0edd..187747be408 100644 --- a/docs/0.29/javascript-environment.html +++ b/docs/0.29/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.29/javascript-environment/index.html b/docs/0.29/javascript-environment/index.html index 5e1e12d0edd..187747be408 100644 --- a/docs/0.29/javascript-environment/index.html +++ b/docs/0.29/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.29/native-components-ios.html b/docs/0.29/native-components-ios.html index 11e08f22ff6..9645daa49df 100644 --- a/docs/0.29/native-components-ios.html +++ b/docs/0.29/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.29/native-components-ios/index.html b/docs/0.29/native-components-ios/index.html index 11e08f22ff6..9645daa49df 100644 --- a/docs/0.29/native-components-ios/index.html +++ b/docs/0.29/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.29/native-modules-android.html b/docs/0.29/native-modules-android.html index 6db51a9fcaf..422614bc967 100644 --- a/docs/0.29/native-modules-android.html +++ b/docs/0.29/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.29/native-modules-android/index.html b/docs/0.29/native-modules-android/index.html index 6db51a9fcaf..422614bc967 100644 --- a/docs/0.29/native-modules-android/index.html +++ b/docs/0.29/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.29/native-modules-ios.html b/docs/0.29/native-modules-ios.html index 829bd94e689..0170516fdd2 100644 --- a/docs/0.29/native-modules-ios.html +++ b/docs/0.29/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.29/performance/index.html b/docs/0.29/performance/index.html index 29ab19db29b..77db793bd2e 100644 --- a/docs/0.29/performance/index.html +++ b/docs/0.29/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.30/getting-started.html b/docs/0.30/getting-started.html index ec0eeb948be..0622f4ba173 100644 --- a/docs/0.30/getting-started.html +++ b/docs/0.30/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.30/getting-started/index.html b/docs/0.30/getting-started/index.html index ec0eeb948be..0622f4ba173 100644 --- a/docs/0.30/getting-started/index.html +++ b/docs/0.30/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.30/integration-with-existing-apps.html b/docs/0.30/integration-with-existing-apps.html index e02dc7d0881..e2f5343a2c8 100644 --- a/docs/0.30/integration-with-existing-apps.html +++ b/docs/0.30/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.30/integration-with-existing-apps/index.html b/docs/0.30/integration-with-existing-apps/index.html index e02dc7d0881..e2f5343a2c8 100644 --- a/docs/0.30/integration-with-existing-apps/index.html +++ b/docs/0.30/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.30/javascript-environment.html b/docs/0.30/javascript-environment.html index 239a98b6041..dcba216d6cd 100644 --- a/docs/0.30/javascript-environment.html +++ b/docs/0.30/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.30/javascript-environment/index.html b/docs/0.30/javascript-environment/index.html index 239a98b6041..dcba216d6cd 100644 --- a/docs/0.30/javascript-environment/index.html +++ b/docs/0.30/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.30/native-components-ios.html b/docs/0.30/native-components-ios.html index 5de41de85b1..4f3d445b250 100644 --- a/docs/0.30/native-components-ios.html +++ b/docs/0.30/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.30/native-components-ios/index.html b/docs/0.30/native-components-ios/index.html index 5de41de85b1..4f3d445b250 100644 --- a/docs/0.30/native-components-ios/index.html +++ b/docs/0.30/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.30/native-modules-android.html b/docs/0.30/native-modules-android.html index 0f74a5afd58..7f5cfcbe538 100644 --- a/docs/0.30/native-modules-android.html +++ b/docs/0.30/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.30/native-modules-android/index.html b/docs/0.30/native-modules-android/index.html index 0f74a5afd58..7f5cfcbe538 100644 --- a/docs/0.30/native-modules-android/index.html +++ b/docs/0.30/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.30/native-modules-ios.html b/docs/0.30/native-modules-ios.html index 10c3a979397..8a9efb77e9d 100644 --- a/docs/0.30/native-modules-ios.html +++ b/docs/0.30/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.30/performance/index.html b/docs/0.30/performance/index.html index 209144af519..857e2b973eb 100644 --- a/docs/0.30/performance/index.html +++ b/docs/0.30/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.31/getting-started.html b/docs/0.31/getting-started.html index db62ecc9f12..6e62f04aa8a 100644 --- a/docs/0.31/getting-started.html +++ b/docs/0.31/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.31/getting-started/index.html b/docs/0.31/getting-started/index.html index db62ecc9f12..6e62f04aa8a 100644 --- a/docs/0.31/getting-started/index.html +++ b/docs/0.31/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.31/integration-with-existing-apps.html b/docs/0.31/integration-with-existing-apps.html index 661f1111f01..2096d228c47 100644 --- a/docs/0.31/integration-with-existing-apps.html +++ b/docs/0.31/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.31/integration-with-existing-apps/index.html b/docs/0.31/integration-with-existing-apps/index.html index 661f1111f01..2096d228c47 100644 --- a/docs/0.31/integration-with-existing-apps/index.html +++ b/docs/0.31/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.31/javascript-environment.html b/docs/0.31/javascript-environment.html index d6a19a42117..e9e2286258d 100644 --- a/docs/0.31/javascript-environment.html +++ b/docs/0.31/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.31/javascript-environment/index.html b/docs/0.31/javascript-environment/index.html index d6a19a42117..e9e2286258d 100644 --- a/docs/0.31/javascript-environment/index.html +++ b/docs/0.31/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.31/native-components-ios.html b/docs/0.31/native-components-ios.html index 1659af2b53f..bdce2bae605 100644 --- a/docs/0.31/native-components-ios.html +++ b/docs/0.31/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.31/native-components-ios/index.html b/docs/0.31/native-components-ios/index.html index 1659af2b53f..bdce2bae605 100644 --- a/docs/0.31/native-components-ios/index.html +++ b/docs/0.31/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.31/native-modules-android.html b/docs/0.31/native-modules-android.html index d23ba939427..6e14851dd77 100644 --- a/docs/0.31/native-modules-android.html +++ b/docs/0.31/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.31/native-modules-android/index.html b/docs/0.31/native-modules-android/index.html index d23ba939427..6e14851dd77 100644 --- a/docs/0.31/native-modules-android/index.html +++ b/docs/0.31/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.31/native-modules-ios.html b/docs/0.31/native-modules-ios.html index c3bfff20913..4a438203efc 100644 --- a/docs/0.31/native-modules-ios.html +++ b/docs/0.31/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.31/performance/index.html b/docs/0.31/performance/index.html index 8c9b81051b6..87c72a3ca87 100644 --- a/docs/0.31/performance/index.html +++ b/docs/0.31/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.32/getting-started.html b/docs/0.32/getting-started.html index f5536ab75ba..e8fcb2491d3 100644 --- a/docs/0.32/getting-started.html +++ b/docs/0.32/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.32/getting-started/index.html b/docs/0.32/getting-started/index.html index f5536ab75ba..e8fcb2491d3 100644 --- a/docs/0.32/getting-started/index.html +++ b/docs/0.32/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.32/integration-with-existing-apps.html b/docs/0.32/integration-with-existing-apps.html index e07bc3191bb..1a855ca1ac3 100644 --- a/docs/0.32/integration-with-existing-apps.html +++ b/docs/0.32/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.32/integration-with-existing-apps/index.html b/docs/0.32/integration-with-existing-apps/index.html index e07bc3191bb..1a855ca1ac3 100644 --- a/docs/0.32/integration-with-existing-apps/index.html +++ b/docs/0.32/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.32/javascript-environment.html b/docs/0.32/javascript-environment.html index f8498640681..fd8a1b39664 100644 --- a/docs/0.32/javascript-environment.html +++ b/docs/0.32/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.32/javascript-environment/index.html b/docs/0.32/javascript-environment/index.html index f8498640681..fd8a1b39664 100644 --- a/docs/0.32/javascript-environment/index.html +++ b/docs/0.32/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.32/native-components-ios.html b/docs/0.32/native-components-ios.html index 88190a70deb..a1a740904de 100644 --- a/docs/0.32/native-components-ios.html +++ b/docs/0.32/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.32/native-components-ios/index.html b/docs/0.32/native-components-ios/index.html index 88190a70deb..a1a740904de 100644 --- a/docs/0.32/native-components-ios/index.html +++ b/docs/0.32/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.32/native-modules-android.html b/docs/0.32/native-modules-android.html index 6c61587e8a5..52e95217947 100644 --- a/docs/0.32/native-modules-android.html +++ b/docs/0.32/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.32/native-modules-android/index.html b/docs/0.32/native-modules-android/index.html index 6c61587e8a5..52e95217947 100644 --- a/docs/0.32/native-modules-android/index.html +++ b/docs/0.32/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.32/native-modules-ios.html b/docs/0.32/native-modules-ios.html index de26cf433ee..552a2e171e9 100644 --- a/docs/0.32/native-modules-ios.html +++ b/docs/0.32/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.32/performance/index.html b/docs/0.32/performance/index.html index 199858b3981..2319c114c0f 100644 --- a/docs/0.32/performance/index.html +++ b/docs/0.32/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.33/getting-started.html b/docs/0.33/getting-started.html index d3aacd62410..16d8fa90c4e 100644 --- a/docs/0.33/getting-started.html +++ b/docs/0.33/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.33/getting-started/index.html b/docs/0.33/getting-started/index.html index d3aacd62410..16d8fa90c4e 100644 --- a/docs/0.33/getting-started/index.html +++ b/docs/0.33/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.33/integration-with-existing-apps.html b/docs/0.33/integration-with-existing-apps.html index f3ef2a45a03..055d4e1dcd6 100644 --- a/docs/0.33/integration-with-existing-apps.html +++ b/docs/0.33/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.33/integration-with-existing-apps/index.html b/docs/0.33/integration-with-existing-apps/index.html index f3ef2a45a03..055d4e1dcd6 100644 --- a/docs/0.33/integration-with-existing-apps/index.html +++ b/docs/0.33/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.33/javascript-environment.html b/docs/0.33/javascript-environment.html index 871989edc2d..2d8b7fe58ee 100644 --- a/docs/0.33/javascript-environment.html +++ b/docs/0.33/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.33/javascript-environment/index.html b/docs/0.33/javascript-environment/index.html index 871989edc2d..2d8b7fe58ee 100644 --- a/docs/0.33/javascript-environment/index.html +++ b/docs/0.33/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.33/native-components-ios.html b/docs/0.33/native-components-ios.html index 14f855d9402..7208e96db2d 100644 --- a/docs/0.33/native-components-ios.html +++ b/docs/0.33/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.33/native-components-ios/index.html b/docs/0.33/native-components-ios/index.html index 14f855d9402..7208e96db2d 100644 --- a/docs/0.33/native-components-ios/index.html +++ b/docs/0.33/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.33/native-modules-android.html b/docs/0.33/native-modules-android.html index 474d68cf573..4b2dd935ad1 100644 --- a/docs/0.33/native-modules-android.html +++ b/docs/0.33/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.33/native-modules-android/index.html b/docs/0.33/native-modules-android/index.html index 474d68cf573..4b2dd935ad1 100644 --- a/docs/0.33/native-modules-android/index.html +++ b/docs/0.33/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.33/native-modules-ios.html b/docs/0.33/native-modules-ios.html index d7496dd7d73..cd52abeb2b5 100644 --- a/docs/0.33/native-modules-ios.html +++ b/docs/0.33/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.33/performance/index.html b/docs/0.33/performance/index.html index cab016bf21c..6ba589ff64e 100644 --- a/docs/0.33/performance/index.html +++ b/docs/0.33/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.34/getting-started.html b/docs/0.34/getting-started.html index 956e153c474..c9e303fa695 100644 --- a/docs/0.34/getting-started.html +++ b/docs/0.34/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.34/getting-started/index.html b/docs/0.34/getting-started/index.html index 956e153c474..c9e303fa695 100644 --- a/docs/0.34/getting-started/index.html +++ b/docs/0.34/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.34/integration-with-existing-apps.html b/docs/0.34/integration-with-existing-apps.html index 99841e610dd..c53bc8ca4a0 100644 --- a/docs/0.34/integration-with-existing-apps.html +++ b/docs/0.34/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.34/integration-with-existing-apps/index.html b/docs/0.34/integration-with-existing-apps/index.html index 99841e610dd..c53bc8ca4a0 100644 --- a/docs/0.34/integration-with-existing-apps/index.html +++ b/docs/0.34/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.34/javascript-environment.html b/docs/0.34/javascript-environment.html index e2ee30a580f..b0ada7397b1 100644 --- a/docs/0.34/javascript-environment.html +++ b/docs/0.34/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.34/javascript-environment/index.html b/docs/0.34/javascript-environment/index.html index e2ee30a580f..b0ada7397b1 100644 --- a/docs/0.34/javascript-environment/index.html +++ b/docs/0.34/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.34/native-components-ios.html b/docs/0.34/native-components-ios.html index 8f8f40195d1..c46326ea196 100644 --- a/docs/0.34/native-components-ios.html +++ b/docs/0.34/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.34/native-components-ios/index.html b/docs/0.34/native-components-ios/index.html index 8f8f40195d1..c46326ea196 100644 --- a/docs/0.34/native-components-ios/index.html +++ b/docs/0.34/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.34/native-modules-android.html b/docs/0.34/native-modules-android.html index f0430999fb6..81e7baf2fdd 100644 --- a/docs/0.34/native-modules-android.html +++ b/docs/0.34/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.34/native-modules-android/index.html b/docs/0.34/native-modules-android/index.html index f0430999fb6..81e7baf2fdd 100644 --- a/docs/0.34/native-modules-android/index.html +++ b/docs/0.34/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.34/native-modules-ios.html b/docs/0.34/native-modules-ios.html index e60c4350ebc..a063708906e 100644 --- a/docs/0.34/native-modules-ios.html +++ b/docs/0.34/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.34/performance/index.html b/docs/0.34/performance/index.html index 54bd6ceabbb..fa699954062 100644 --- a/docs/0.34/performance/index.html +++ b/docs/0.34/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.35/getting-started.html b/docs/0.35/getting-started.html index add0c5bef5b..02718f2e761 100644 --- a/docs/0.35/getting-started.html +++ b/docs/0.35/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.35/getting-started/index.html b/docs/0.35/getting-started/index.html index add0c5bef5b..02718f2e761 100644 --- a/docs/0.35/getting-started/index.html +++ b/docs/0.35/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.35/integration-with-existing-apps.html b/docs/0.35/integration-with-existing-apps.html index 7be1fd4dd42..eb12df7084e 100644 --- a/docs/0.35/integration-with-existing-apps.html +++ b/docs/0.35/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.35/integration-with-existing-apps/index.html b/docs/0.35/integration-with-existing-apps/index.html index 7be1fd4dd42..eb12df7084e 100644 --- a/docs/0.35/integration-with-existing-apps/index.html +++ b/docs/0.35/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.35/javascript-environment.html b/docs/0.35/javascript-environment.html index 33870c672d6..e5600ff2487 100644 --- a/docs/0.35/javascript-environment.html +++ b/docs/0.35/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.35/javascript-environment/index.html b/docs/0.35/javascript-environment/index.html index 33870c672d6..e5600ff2487 100644 --- a/docs/0.35/javascript-environment/index.html +++ b/docs/0.35/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.35/native-components-ios.html b/docs/0.35/native-components-ios.html index 89feb4395c5..bb6436d03a2 100644 --- a/docs/0.35/native-components-ios.html +++ b/docs/0.35/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.35/native-components-ios/index.html b/docs/0.35/native-components-ios/index.html index 89feb4395c5..bb6436d03a2 100644 --- a/docs/0.35/native-components-ios/index.html +++ b/docs/0.35/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.35/native-modules-android.html b/docs/0.35/native-modules-android.html index 05e9381dc09..9f06077febe 100644 --- a/docs/0.35/native-modules-android.html +++ b/docs/0.35/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.35/native-modules-android/index.html b/docs/0.35/native-modules-android/index.html index 05e9381dc09..9f06077febe 100644 --- a/docs/0.35/native-modules-android/index.html +++ b/docs/0.35/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.35/native-modules-ios.html b/docs/0.35/native-modules-ios.html index 26b7ec1adf0..3632c6289bb 100644 --- a/docs/0.35/native-modules-ios.html +++ b/docs/0.35/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.35/performance/index.html b/docs/0.35/performance/index.html index da0efbd2397..6b0783e0598 100644 --- a/docs/0.35/performance/index.html +++ b/docs/0.35/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.36/getting-started.html b/docs/0.36/getting-started.html index c0c453c43ea..17914112993 100644 --- a/docs/0.36/getting-started.html +++ b/docs/0.36/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.36/getting-started/index.html b/docs/0.36/getting-started/index.html index c0c453c43ea..17914112993 100644 --- a/docs/0.36/getting-started/index.html +++ b/docs/0.36/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.36/integration-with-existing-apps.html b/docs/0.36/integration-with-existing-apps.html index a74e1f6c950..3967555f6cf 100644 --- a/docs/0.36/integration-with-existing-apps.html +++ b/docs/0.36/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.36/integration-with-existing-apps/index.html b/docs/0.36/integration-with-existing-apps/index.html index a74e1f6c950..3967555f6cf 100644 --- a/docs/0.36/integration-with-existing-apps/index.html +++ b/docs/0.36/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.36/javascript-environment.html b/docs/0.36/javascript-environment.html index 75ebd23f9df..e2ac5d80ff4 100644 --- a/docs/0.36/javascript-environment.html +++ b/docs/0.36/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.36/javascript-environment/index.html b/docs/0.36/javascript-environment/index.html index 75ebd23f9df..e2ac5d80ff4 100644 --- a/docs/0.36/javascript-environment/index.html +++ b/docs/0.36/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.36/native-components-ios.html b/docs/0.36/native-components-ios.html index c0532553cd7..d4615099803 100644 --- a/docs/0.36/native-components-ios.html +++ b/docs/0.36/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.36/native-components-ios/index.html b/docs/0.36/native-components-ios/index.html index c0532553cd7..d4615099803 100644 --- a/docs/0.36/native-components-ios/index.html +++ b/docs/0.36/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.36/native-modules-android.html b/docs/0.36/native-modules-android.html index be11891f6d4..52dafbb140c 100644 --- a/docs/0.36/native-modules-android.html +++ b/docs/0.36/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.36/native-modules-android/index.html b/docs/0.36/native-modules-android/index.html index be11891f6d4..52dafbb140c 100644 --- a/docs/0.36/native-modules-android/index.html +++ b/docs/0.36/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.36/native-modules-ios.html b/docs/0.36/native-modules-ios.html index 92e5151b17c..4cac00ee8b2 100644 --- a/docs/0.36/native-modules-ios.html +++ b/docs/0.36/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.36/performance/index.html b/docs/0.36/performance/index.html index 01eb0214c76..be5afc967ec 100644 --- a/docs/0.36/performance/index.html +++ b/docs/0.36/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.37/getting-started.html b/docs/0.37/getting-started.html index 91abddcbfe4..eb5bd24ec0e 100644 --- a/docs/0.37/getting-started.html +++ b/docs/0.37/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.37/getting-started/index.html b/docs/0.37/getting-started/index.html index 91abddcbfe4..eb5bd24ec0e 100644 --- a/docs/0.37/getting-started/index.html +++ b/docs/0.37/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.37/integration-with-existing-apps.html b/docs/0.37/integration-with-existing-apps.html index 0868f94943d..67f2deb03b9 100644 --- a/docs/0.37/integration-with-existing-apps.html +++ b/docs/0.37/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.37/integration-with-existing-apps/index.html b/docs/0.37/integration-with-existing-apps/index.html index 0868f94943d..67f2deb03b9 100644 --- a/docs/0.37/integration-with-existing-apps/index.html +++ b/docs/0.37/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.37/javascript-environment.html b/docs/0.37/javascript-environment.html index bab8a71959d..44f0619f6ed 100644 --- a/docs/0.37/javascript-environment.html +++ b/docs/0.37/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.37/javascript-environment/index.html b/docs/0.37/javascript-environment/index.html index bab8a71959d..44f0619f6ed 100644 --- a/docs/0.37/javascript-environment/index.html +++ b/docs/0.37/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.37/native-components-ios.html b/docs/0.37/native-components-ios.html index f87ed98ded4..af2ed45fff4 100644 --- a/docs/0.37/native-components-ios.html +++ b/docs/0.37/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.37/native-components-ios/index.html b/docs/0.37/native-components-ios/index.html index f87ed98ded4..af2ed45fff4 100644 --- a/docs/0.37/native-components-ios/index.html +++ b/docs/0.37/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.37/native-modules-android.html b/docs/0.37/native-modules-android.html index 0b84df270dd..c16c1fdcd33 100644 --- a/docs/0.37/native-modules-android.html +++ b/docs/0.37/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.37/native-modules-android/index.html b/docs/0.37/native-modules-android/index.html index 0b84df270dd..c16c1fdcd33 100644 --- a/docs/0.37/native-modules-android/index.html +++ b/docs/0.37/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.37/native-modules-ios.html b/docs/0.37/native-modules-ios.html index e29f5d1ff6b..e17f5525602 100644 --- a/docs/0.37/native-modules-ios.html +++ b/docs/0.37/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.37/performance/index.html b/docs/0.37/performance/index.html index 5f56ecee276..5bcdcbd9cfd 100644 --- a/docs/0.37/performance/index.html +++ b/docs/0.37/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.38/getting-started.html b/docs/0.38/getting-started.html index 61c2402b89d..c2573d4be15 100644 --- a/docs/0.38/getting-started.html +++ b/docs/0.38/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.38/getting-started/index.html b/docs/0.38/getting-started/index.html index 61c2402b89d..c2573d4be15 100644 --- a/docs/0.38/getting-started/index.html +++ b/docs/0.38/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.38/integration-with-existing-apps.html b/docs/0.38/integration-with-existing-apps.html index 86e6f0bff9d..fd88f729542 100644 --- a/docs/0.38/integration-with-existing-apps.html +++ b/docs/0.38/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.38/integration-with-existing-apps/index.html b/docs/0.38/integration-with-existing-apps/index.html index 86e6f0bff9d..fd88f729542 100644 --- a/docs/0.38/integration-with-existing-apps/index.html +++ b/docs/0.38/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.38/javascript-environment.html b/docs/0.38/javascript-environment.html index 0a94ce96af8..64e8054197f 100644 --- a/docs/0.38/javascript-environment.html +++ b/docs/0.38/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.38/javascript-environment/index.html b/docs/0.38/javascript-environment/index.html index 0a94ce96af8..64e8054197f 100644 --- a/docs/0.38/javascript-environment/index.html +++ b/docs/0.38/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.38/native-components-ios.html b/docs/0.38/native-components-ios.html index e64c39622e4..6ead3141b7d 100644 --- a/docs/0.38/native-components-ios.html +++ b/docs/0.38/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.38/native-components-ios/index.html b/docs/0.38/native-components-ios/index.html index e64c39622e4..6ead3141b7d 100644 --- a/docs/0.38/native-components-ios/index.html +++ b/docs/0.38/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.38/native-modules-android.html b/docs/0.38/native-modules-android.html index 2bdbbacaca8..f7480664cfb 100644 --- a/docs/0.38/native-modules-android.html +++ b/docs/0.38/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.38/native-modules-android/index.html b/docs/0.38/native-modules-android/index.html index 2bdbbacaca8..f7480664cfb 100644 --- a/docs/0.38/native-modules-android/index.html +++ b/docs/0.38/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.38/native-modules-ios.html b/docs/0.38/native-modules-ios.html index caaf102bf2e..a74419cad1f 100644 --- a/docs/0.38/native-modules-ios.html +++ b/docs/0.38/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.38/performance/index.html b/docs/0.38/performance/index.html index d410a01f1b9..fba3bb5dc2c 100644 --- a/docs/0.38/performance/index.html +++ b/docs/0.38/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.39/getting-started.html b/docs/0.39/getting-started.html index 282fef519ae..fb31f5515d8 100644 --- a/docs/0.39/getting-started.html +++ b/docs/0.39/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.39/getting-started/index.html b/docs/0.39/getting-started/index.html index 282fef519ae..fb31f5515d8 100644 --- a/docs/0.39/getting-started/index.html +++ b/docs/0.39/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.39/integration-with-existing-apps.html b/docs/0.39/integration-with-existing-apps.html index b63d7a66788..131d6fcc0aa 100644 --- a/docs/0.39/integration-with-existing-apps.html +++ b/docs/0.39/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.39/integration-with-existing-apps/index.html b/docs/0.39/integration-with-existing-apps/index.html index b63d7a66788..131d6fcc0aa 100644 --- a/docs/0.39/integration-with-existing-apps/index.html +++ b/docs/0.39/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.39/javascript-environment.html b/docs/0.39/javascript-environment.html index 0f966b5c30e..4605289b614 100644 --- a/docs/0.39/javascript-environment.html +++ b/docs/0.39/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.39/javascript-environment/index.html b/docs/0.39/javascript-environment/index.html index 0f966b5c30e..4605289b614 100644 --- a/docs/0.39/javascript-environment/index.html +++ b/docs/0.39/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.39/native-components-ios.html b/docs/0.39/native-components-ios.html index 357c0c16cbb..b5520b46029 100644 --- a/docs/0.39/native-components-ios.html +++ b/docs/0.39/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.39/native-components-ios/index.html b/docs/0.39/native-components-ios/index.html index 357c0c16cbb..b5520b46029 100644 --- a/docs/0.39/native-components-ios/index.html +++ b/docs/0.39/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.39/native-modules-android.html b/docs/0.39/native-modules-android.html index eb8cc77ab72..2bb32f2d4d4 100644 --- a/docs/0.39/native-modules-android.html +++ b/docs/0.39/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.39/native-modules-android/index.html b/docs/0.39/native-modules-android/index.html index eb8cc77ab72..2bb32f2d4d4 100644 --- a/docs/0.39/native-modules-android/index.html +++ b/docs/0.39/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.39/native-modules-ios.html b/docs/0.39/native-modules-ios.html index ba860a22e54..a8605d0ffee 100644 --- a/docs/0.39/native-modules-ios.html +++ b/docs/0.39/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.39/performance/index.html b/docs/0.39/performance/index.html index 487f00f801f..a9d95627436 100644 --- a/docs/0.39/performance/index.html +++ b/docs/0.39/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.40/getting-started.html b/docs/0.40/getting-started.html index 847b89f4df7..6d3754ced89 100644 --- a/docs/0.40/getting-started.html +++ b/docs/0.40/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.40/getting-started/index.html b/docs/0.40/getting-started/index.html index 847b89f4df7..6d3754ced89 100644 --- a/docs/0.40/getting-started/index.html +++ b/docs/0.40/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.40/integration-with-existing-apps.html b/docs/0.40/integration-with-existing-apps.html index a3137dc3eb3..460afbde927 100644 --- a/docs/0.40/integration-with-existing-apps.html +++ b/docs/0.40/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.40/integration-with-existing-apps/index.html b/docs/0.40/integration-with-existing-apps/index.html index a3137dc3eb3..460afbde927 100644 --- a/docs/0.40/integration-with-existing-apps/index.html +++ b/docs/0.40/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.40/javascript-environment.html b/docs/0.40/javascript-environment.html index a5d75785b7f..00c11f1d504 100644 --- a/docs/0.40/javascript-environment.html +++ b/docs/0.40/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.40/javascript-environment/index.html b/docs/0.40/javascript-environment/index.html index a5d75785b7f..00c11f1d504 100644 --- a/docs/0.40/javascript-environment/index.html +++ b/docs/0.40/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.40/native-components-ios.html b/docs/0.40/native-components-ios.html index da3f70c061f..e90278faf07 100644 --- a/docs/0.40/native-components-ios.html +++ b/docs/0.40/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.40/native-components-ios/index.html b/docs/0.40/native-components-ios/index.html index da3f70c061f..e90278faf07 100644 --- a/docs/0.40/native-components-ios/index.html +++ b/docs/0.40/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.40/native-modules-android.html b/docs/0.40/native-modules-android.html index a9001ed35a3..f20fb4bc0ed 100644 --- a/docs/0.40/native-modules-android.html +++ b/docs/0.40/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.40/native-modules-android/index.html b/docs/0.40/native-modules-android/index.html index a9001ed35a3..f20fb4bc0ed 100644 --- a/docs/0.40/native-modules-android/index.html +++ b/docs/0.40/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.40/native-modules-ios.html b/docs/0.40/native-modules-ios.html index 2ff225643d9..936faa1291f 100644 --- a/docs/0.40/native-modules-ios.html +++ b/docs/0.40/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.40/performance/index.html b/docs/0.40/performance/index.html index a4ef8254ac6..f927f157aab 100644 --- a/docs/0.40/performance/index.html +++ b/docs/0.40/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.41/getting-started.html b/docs/0.41/getting-started.html index 655350fb9de..8549ff5a919 100644 --- a/docs/0.41/getting-started.html +++ b/docs/0.41/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.41/getting-started/index.html b/docs/0.41/getting-started/index.html index 655350fb9de..8549ff5a919 100644 --- a/docs/0.41/getting-started/index.html +++ b/docs/0.41/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.41/integration-with-existing-apps.html b/docs/0.41/integration-with-existing-apps.html index ceb21ab789a..b6e3d475bd1 100644 --- a/docs/0.41/integration-with-existing-apps.html +++ b/docs/0.41/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.41/integration-with-existing-apps/index.html b/docs/0.41/integration-with-existing-apps/index.html index ceb21ab789a..b6e3d475bd1 100644 --- a/docs/0.41/integration-with-existing-apps/index.html +++ b/docs/0.41/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.41/javascript-environment.html b/docs/0.41/javascript-environment.html index 5caa7f90f39..df7e5decef8 100644 --- a/docs/0.41/javascript-environment.html +++ b/docs/0.41/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.41/javascript-environment/index.html b/docs/0.41/javascript-environment/index.html index 5caa7f90f39..df7e5decef8 100644 --- a/docs/0.41/javascript-environment/index.html +++ b/docs/0.41/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.41/native-components-ios.html b/docs/0.41/native-components-ios.html index 7fe1489a909..d4647ca9445 100644 --- a/docs/0.41/native-components-ios.html +++ b/docs/0.41/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.41/native-components-ios/index.html b/docs/0.41/native-components-ios/index.html index 7fe1489a909..d4647ca9445 100644 --- a/docs/0.41/native-components-ios/index.html +++ b/docs/0.41/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.41/native-modules-android.html b/docs/0.41/native-modules-android.html index 961d1948961..65cba83eae8 100644 --- a/docs/0.41/native-modules-android.html +++ b/docs/0.41/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.41/native-modules-android/index.html b/docs/0.41/native-modules-android/index.html index 961d1948961..65cba83eae8 100644 --- a/docs/0.41/native-modules-android/index.html +++ b/docs/0.41/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.41/native-modules-ios.html b/docs/0.41/native-modules-ios.html index e9013909943..2ef8e489432 100644 --- a/docs/0.41/native-modules-ios.html +++ b/docs/0.41/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.41/performance/index.html b/docs/0.41/performance/index.html index b5bd026ac0f..81974a9f5e0 100644 --- a/docs/0.41/performance/index.html +++ b/docs/0.41/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.42/getting-started.html b/docs/0.42/getting-started.html index 83d9861f462..a500d28d108 100644 --- a/docs/0.42/getting-started.html +++ b/docs/0.42/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.42/getting-started/index.html b/docs/0.42/getting-started/index.html index 83d9861f462..a500d28d108 100644 --- a/docs/0.42/getting-started/index.html +++ b/docs/0.42/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.42/integration-with-existing-apps.html b/docs/0.42/integration-with-existing-apps.html index 1a18f37df4e..0bafaa2ec0d 100644 --- a/docs/0.42/integration-with-existing-apps.html +++ b/docs/0.42/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.42/integration-with-existing-apps/index.html b/docs/0.42/integration-with-existing-apps/index.html index 1a18f37df4e..0bafaa2ec0d 100644 --- a/docs/0.42/integration-with-existing-apps/index.html +++ b/docs/0.42/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.42/javascript-environment.html b/docs/0.42/javascript-environment.html index a399e5e4ecb..8e8c68aaff3 100644 --- a/docs/0.42/javascript-environment.html +++ b/docs/0.42/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.42/javascript-environment/index.html b/docs/0.42/javascript-environment/index.html index a399e5e4ecb..8e8c68aaff3 100644 --- a/docs/0.42/javascript-environment/index.html +++ b/docs/0.42/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.42/native-components-ios.html b/docs/0.42/native-components-ios.html index bd0bd52a2ef..4faa3d265f6 100644 --- a/docs/0.42/native-components-ios.html +++ b/docs/0.42/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.42/native-components-ios/index.html b/docs/0.42/native-components-ios/index.html index bd0bd52a2ef..4faa3d265f6 100644 --- a/docs/0.42/native-components-ios/index.html +++ b/docs/0.42/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.42/native-modules-android.html b/docs/0.42/native-modules-android.html index 6507c014409..22bc5b7bcd8 100644 --- a/docs/0.42/native-modules-android.html +++ b/docs/0.42/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.42/native-modules-android/index.html b/docs/0.42/native-modules-android/index.html index 6507c014409..22bc5b7bcd8 100644 --- a/docs/0.42/native-modules-android/index.html +++ b/docs/0.42/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.42/native-modules-ios.html b/docs/0.42/native-modules-ios.html index 48713152534..e33e04bf1e3 100644 --- a/docs/0.42/native-modules-ios.html +++ b/docs/0.42/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.42/performance/index.html b/docs/0.42/performance/index.html index dbd8a7b0280..e517c911901 100644 --- a/docs/0.42/performance/index.html +++ b/docs/0.42/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.43/getting-started.html b/docs/0.43/getting-started.html index 319f9f96efa..0433e74edf1 100644 --- a/docs/0.43/getting-started.html +++ b/docs/0.43/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.43/getting-started/index.html b/docs/0.43/getting-started/index.html index 319f9f96efa..0433e74edf1 100644 --- a/docs/0.43/getting-started/index.html +++ b/docs/0.43/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.43/integration-with-existing-apps.html b/docs/0.43/integration-with-existing-apps.html index e38daf1522e..3292985f6c3 100644 --- a/docs/0.43/integration-with-existing-apps.html +++ b/docs/0.43/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.43/integration-with-existing-apps/index.html b/docs/0.43/integration-with-existing-apps/index.html index e38daf1522e..3292985f6c3 100644 --- a/docs/0.43/integration-with-existing-apps/index.html +++ b/docs/0.43/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.43/javascript-environment.html b/docs/0.43/javascript-environment.html index 7f3e1131c7b..6ee9e2f48cb 100644 --- a/docs/0.43/javascript-environment.html +++ b/docs/0.43/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.43/javascript-environment/index.html b/docs/0.43/javascript-environment/index.html index 7f3e1131c7b..6ee9e2f48cb 100644 --- a/docs/0.43/javascript-environment/index.html +++ b/docs/0.43/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.43/native-components-ios.html b/docs/0.43/native-components-ios.html index 274935a656a..48553232522 100644 --- a/docs/0.43/native-components-ios.html +++ b/docs/0.43/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.43/native-components-ios/index.html b/docs/0.43/native-components-ios/index.html index 274935a656a..48553232522 100644 --- a/docs/0.43/native-components-ios/index.html +++ b/docs/0.43/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.43/native-modules-android.html b/docs/0.43/native-modules-android.html index 80e34258603..8ae44ea9527 100644 --- a/docs/0.43/native-modules-android.html +++ b/docs/0.43/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.43/native-modules-android/index.html b/docs/0.43/native-modules-android/index.html index 80e34258603..8ae44ea9527 100644 --- a/docs/0.43/native-modules-android/index.html +++ b/docs/0.43/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.43/native-modules-ios.html b/docs/0.43/native-modules-ios.html index 3878f03c6d1..babea7cf892 100644 --- a/docs/0.43/native-modules-ios.html +++ b/docs/0.43/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.43/performance/index.html b/docs/0.43/performance/index.html index b34e51319c9..5ad9b3cb4df 100644 --- a/docs/0.43/performance/index.html +++ b/docs/0.43/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.44/getting-started.html b/docs/0.44/getting-started.html index e0cd932dca8..afd4d518021 100644 --- a/docs/0.44/getting-started.html +++ b/docs/0.44/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.44/getting-started/index.html b/docs/0.44/getting-started/index.html index e0cd932dca8..afd4d518021 100644 --- a/docs/0.44/getting-started/index.html +++ b/docs/0.44/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.44/integration-with-existing-apps.html b/docs/0.44/integration-with-existing-apps.html index e64ce699527..4a3381ca5a8 100644 --- a/docs/0.44/integration-with-existing-apps.html +++ b/docs/0.44/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.44/integration-with-existing-apps/index.html b/docs/0.44/integration-with-existing-apps/index.html index e64ce699527..4a3381ca5a8 100644 --- a/docs/0.44/integration-with-existing-apps/index.html +++ b/docs/0.44/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.44/javascript-environment.html b/docs/0.44/javascript-environment.html index 2370dd63ff3..128b5d3aa03 100644 --- a/docs/0.44/javascript-environment.html +++ b/docs/0.44/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.44/javascript-environment/index.html b/docs/0.44/javascript-environment/index.html index 2370dd63ff3..128b5d3aa03 100644 --- a/docs/0.44/javascript-environment/index.html +++ b/docs/0.44/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.44/native-components-ios.html b/docs/0.44/native-components-ios.html index baab6260d37..8f3f0433a47 100644 --- a/docs/0.44/native-components-ios.html +++ b/docs/0.44/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.44/native-components-ios/index.html b/docs/0.44/native-components-ios/index.html index baab6260d37..8f3f0433a47 100644 --- a/docs/0.44/native-components-ios/index.html +++ b/docs/0.44/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.44/native-modules-android.html b/docs/0.44/native-modules-android.html index 356b8b515ca..e34bc91ff4c 100644 --- a/docs/0.44/native-modules-android.html +++ b/docs/0.44/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.44/native-modules-android/index.html b/docs/0.44/native-modules-android/index.html index 356b8b515ca..e34bc91ff4c 100644 --- a/docs/0.44/native-modules-android/index.html +++ b/docs/0.44/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.44/native-modules-ios.html b/docs/0.44/native-modules-ios.html index 6c7c566b12a..d9b5770e4be 100644 --- a/docs/0.44/native-modules-ios.html +++ b/docs/0.44/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.44/performance/index.html b/docs/0.44/performance/index.html index a05bd2182d9..384b0cc5835 100644 --- a/docs/0.44/performance/index.html +++ b/docs/0.44/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.45/getting-started.html b/docs/0.45/getting-started.html index 29ebe2ac6e4..6427bb0abcc 100644 --- a/docs/0.45/getting-started.html +++ b/docs/0.45/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.45/getting-started/index.html b/docs/0.45/getting-started/index.html index 29ebe2ac6e4..6427bb0abcc 100644 --- a/docs/0.45/getting-started/index.html +++ b/docs/0.45/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.45/integration-with-existing-apps.html b/docs/0.45/integration-with-existing-apps.html index 01a4f311eb8..2590c6e22b5 100644 --- a/docs/0.45/integration-with-existing-apps.html +++ b/docs/0.45/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.45/integration-with-existing-apps/index.html b/docs/0.45/integration-with-existing-apps/index.html index 01a4f311eb8..2590c6e22b5 100644 --- a/docs/0.45/integration-with-existing-apps/index.html +++ b/docs/0.45/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.45/javascript-environment.html b/docs/0.45/javascript-environment.html index 15454220fcd..d3e138d73b9 100644 --- a/docs/0.45/javascript-environment.html +++ b/docs/0.45/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.45/javascript-environment/index.html b/docs/0.45/javascript-environment/index.html index 15454220fcd..d3e138d73b9 100644 --- a/docs/0.45/javascript-environment/index.html +++ b/docs/0.45/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.45/native-components-ios.html b/docs/0.45/native-components-ios.html index 7097568ec1b..5aa48ba567c 100644 --- a/docs/0.45/native-components-ios.html +++ b/docs/0.45/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.45/native-components-ios/index.html b/docs/0.45/native-components-ios/index.html index 7097568ec1b..5aa48ba567c 100644 --- a/docs/0.45/native-components-ios/index.html +++ b/docs/0.45/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.45/native-modules-android.html b/docs/0.45/native-modules-android.html index 832bb670f35..1ccb77c2e35 100644 --- a/docs/0.45/native-modules-android.html +++ b/docs/0.45/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.45/native-modules-android/index.html b/docs/0.45/native-modules-android/index.html index 832bb670f35..1ccb77c2e35 100644 --- a/docs/0.45/native-modules-android/index.html +++ b/docs/0.45/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.45/native-modules-ios.html b/docs/0.45/native-modules-ios.html index 36a92ffc58f..c076e0188df 100644 --- a/docs/0.45/native-modules-ios.html +++ b/docs/0.45/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.45/performance/index.html b/docs/0.45/performance/index.html index fa55d1666f5..012f9567df8 100644 --- a/docs/0.45/performance/index.html +++ b/docs/0.45/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.46/getting-started.html b/docs/0.46/getting-started.html index 7d91d2b5565..f736f37166c 100644 --- a/docs/0.46/getting-started.html +++ b/docs/0.46/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.46/getting-started/index.html b/docs/0.46/getting-started/index.html index 7d91d2b5565..f736f37166c 100644 --- a/docs/0.46/getting-started/index.html +++ b/docs/0.46/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.46/integration-with-existing-apps.html b/docs/0.46/integration-with-existing-apps.html index 6d679ed804d..e7dd367d3ed 100644 --- a/docs/0.46/integration-with-existing-apps.html +++ b/docs/0.46/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.46/integration-with-existing-apps/index.html b/docs/0.46/integration-with-existing-apps/index.html index 6d679ed804d..e7dd367d3ed 100644 --- a/docs/0.46/integration-with-existing-apps/index.html +++ b/docs/0.46/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.46/javascript-environment.html b/docs/0.46/javascript-environment.html index b6c4489661a..85cddcddb3d 100644 --- a/docs/0.46/javascript-environment.html +++ b/docs/0.46/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.46/javascript-environment/index.html b/docs/0.46/javascript-environment/index.html index b6c4489661a..85cddcddb3d 100644 --- a/docs/0.46/javascript-environment/index.html +++ b/docs/0.46/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.46/native-components-ios.html b/docs/0.46/native-components-ios.html index 5f51500fad4..efc2ede1863 100644 --- a/docs/0.46/native-components-ios.html +++ b/docs/0.46/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.46/native-components-ios/index.html b/docs/0.46/native-components-ios/index.html index 5f51500fad4..efc2ede1863 100644 --- a/docs/0.46/native-components-ios/index.html +++ b/docs/0.46/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.46/native-modules-android.html b/docs/0.46/native-modules-android.html index d0512d026ac..7eafe4eaa29 100644 --- a/docs/0.46/native-modules-android.html +++ b/docs/0.46/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.46/native-modules-android/index.html b/docs/0.46/native-modules-android/index.html index d0512d026ac..7eafe4eaa29 100644 --- a/docs/0.46/native-modules-android/index.html +++ b/docs/0.46/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.46/native-modules-ios.html b/docs/0.46/native-modules-ios.html index a508fb96f6f..9241c0291f0 100644 --- a/docs/0.46/native-modules-ios.html +++ b/docs/0.46/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.46/performance/index.html b/docs/0.46/performance/index.html index 5dc4e1fe21e..482d4e1df8f 100644 --- a/docs/0.46/performance/index.html +++ b/docs/0.46/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.47/getting-started.html b/docs/0.47/getting-started.html index 886327552b1..2e3edbfe50e 100644 --- a/docs/0.47/getting-started.html +++ b/docs/0.47/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.47/getting-started/index.html b/docs/0.47/getting-started/index.html index 886327552b1..2e3edbfe50e 100644 --- a/docs/0.47/getting-started/index.html +++ b/docs/0.47/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.47/integration-with-existing-apps.html b/docs/0.47/integration-with-existing-apps.html index 6bc3e3eb5be..18a87869193 100644 --- a/docs/0.47/integration-with-existing-apps.html +++ b/docs/0.47/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.47/integration-with-existing-apps/index.html b/docs/0.47/integration-with-existing-apps/index.html index 6bc3e3eb5be..18a87869193 100644 --- a/docs/0.47/integration-with-existing-apps/index.html +++ b/docs/0.47/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.47/javascript-environment.html b/docs/0.47/javascript-environment.html index c06b3e95ea1..51a6731af80 100644 --- a/docs/0.47/javascript-environment.html +++ b/docs/0.47/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.47/javascript-environment/index.html b/docs/0.47/javascript-environment/index.html index c06b3e95ea1..51a6731af80 100644 --- a/docs/0.47/javascript-environment/index.html +++ b/docs/0.47/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.47/native-components-ios.html b/docs/0.47/native-components-ios.html index 139eaf16493..f37a59ad0c9 100644 --- a/docs/0.47/native-components-ios.html +++ b/docs/0.47/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.47/native-components-ios/index.html b/docs/0.47/native-components-ios/index.html index 139eaf16493..f37a59ad0c9 100644 --- a/docs/0.47/native-components-ios/index.html +++ b/docs/0.47/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.47/native-modules-android.html b/docs/0.47/native-modules-android.html index 2db1cc4dda4..34909534623 100644 --- a/docs/0.47/native-modules-android.html +++ b/docs/0.47/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.47/native-modules-android/index.html b/docs/0.47/native-modules-android/index.html index 2db1cc4dda4..34909534623 100644 --- a/docs/0.47/native-modules-android/index.html +++ b/docs/0.47/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.47/native-modules-ios.html b/docs/0.47/native-modules-ios.html index 16e47ddaabf..3aec941f9e7 100644 --- a/docs/0.47/native-modules-ios.html +++ b/docs/0.47/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.47/performance/index.html b/docs/0.47/performance/index.html index 2d98eb1cb8e..56ba6c8581c 100644 --- a/docs/0.47/performance/index.html +++ b/docs/0.47/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.48/getting-started.html b/docs/0.48/getting-started.html index 838a14d285b..98071904b66 100644 --- a/docs/0.48/getting-started.html +++ b/docs/0.48/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.48/getting-started/index.html b/docs/0.48/getting-started/index.html index 838a14d285b..98071904b66 100644 --- a/docs/0.48/getting-started/index.html +++ b/docs/0.48/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.48/integration-with-existing-apps.html b/docs/0.48/integration-with-existing-apps.html index 3ac94ea1d86..baac34fbdfa 100644 --- a/docs/0.48/integration-with-existing-apps.html +++ b/docs/0.48/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.48/integration-with-existing-apps/index.html b/docs/0.48/integration-with-existing-apps/index.html index 3ac94ea1d86..baac34fbdfa 100644 --- a/docs/0.48/integration-with-existing-apps/index.html +++ b/docs/0.48/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.48/javascript-environment.html b/docs/0.48/javascript-environment.html index 77a17e8e40a..2a499eb9d58 100644 --- a/docs/0.48/javascript-environment.html +++ b/docs/0.48/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.48/javascript-environment/index.html b/docs/0.48/javascript-environment/index.html index 77a17e8e40a..2a499eb9d58 100644 --- a/docs/0.48/javascript-environment/index.html +++ b/docs/0.48/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.48/native-components-ios.html b/docs/0.48/native-components-ios.html index 7e7ebef6c17..87457bcb364 100644 --- a/docs/0.48/native-components-ios.html +++ b/docs/0.48/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.48/native-components-ios/index.html b/docs/0.48/native-components-ios/index.html index 7e7ebef6c17..87457bcb364 100644 --- a/docs/0.48/native-components-ios/index.html +++ b/docs/0.48/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.48/native-modules-android.html b/docs/0.48/native-modules-android.html index 26a18855738..cd7d9728f86 100644 --- a/docs/0.48/native-modules-android.html +++ b/docs/0.48/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.48/native-modules-android/index.html b/docs/0.48/native-modules-android/index.html index 26a18855738..cd7d9728f86 100644 --- a/docs/0.48/native-modules-android/index.html +++ b/docs/0.48/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.48/native-modules-ios.html b/docs/0.48/native-modules-ios.html index 43ecac0a8e9..f22a4c0d88c 100644 --- a/docs/0.48/native-modules-ios.html +++ b/docs/0.48/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.48/performance/index.html b/docs/0.48/performance/index.html index 2f0b329ea9e..ae26fd3cca9 100644 --- a/docs/0.48/performance/index.html +++ b/docs/0.48/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.49/getting-started.html b/docs/0.49/getting-started.html index b9e12a20f61..ed5a37b50c6 100644 --- a/docs/0.49/getting-started.html +++ b/docs/0.49/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.49/getting-started/index.html b/docs/0.49/getting-started/index.html index b9e12a20f61..ed5a37b50c6 100644 --- a/docs/0.49/getting-started/index.html +++ b/docs/0.49/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.49/integration-with-existing-apps.html b/docs/0.49/integration-with-existing-apps.html index dde84f6c3f8..f079d810328 100644 --- a/docs/0.49/integration-with-existing-apps.html +++ b/docs/0.49/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.49/integration-with-existing-apps/index.html b/docs/0.49/integration-with-existing-apps/index.html index dde84f6c3f8..f079d810328 100644 --- a/docs/0.49/integration-with-existing-apps/index.html +++ b/docs/0.49/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.49/javascript-environment.html b/docs/0.49/javascript-environment.html index 7bb5f83da0f..33b032befa0 100644 --- a/docs/0.49/javascript-environment.html +++ b/docs/0.49/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.49/javascript-environment/index.html b/docs/0.49/javascript-environment/index.html index 7bb5f83da0f..33b032befa0 100644 --- a/docs/0.49/javascript-environment/index.html +++ b/docs/0.49/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.49/native-components-ios.html b/docs/0.49/native-components-ios.html index 7fae1473df3..1d4f8575539 100644 --- a/docs/0.49/native-components-ios.html +++ b/docs/0.49/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.49/native-components-ios/index.html b/docs/0.49/native-components-ios/index.html index 7fae1473df3..1d4f8575539 100644 --- a/docs/0.49/native-components-ios/index.html +++ b/docs/0.49/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.49/native-modules-android.html b/docs/0.49/native-modules-android.html index 449f6372b37..d103180c3fd 100644 --- a/docs/0.49/native-modules-android.html +++ b/docs/0.49/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.49/native-modules-android/index.html b/docs/0.49/native-modules-android/index.html index 449f6372b37..d103180c3fd 100644 --- a/docs/0.49/native-modules-android/index.html +++ b/docs/0.49/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.49/native-modules-ios.html b/docs/0.49/native-modules-ios.html index 6f43b7e34d6..f00d3570d03 100644 --- a/docs/0.49/native-modules-ios.html +++ b/docs/0.49/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.49/performance/index.html b/docs/0.49/performance/index.html index 4cc4e75e677..f901abbeab1 100644 --- a/docs/0.49/performance/index.html +++ b/docs/0.49/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.5/getting-started.html b/docs/0.5/getting-started.html index 33c7e396259..eff3ebc33c1 100644 --- a/docs/0.5/getting-started.html +++ b/docs/0.5/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.5/getting-started/index.html b/docs/0.5/getting-started/index.html index 33c7e396259..eff3ebc33c1 100644 --- a/docs/0.5/getting-started/index.html +++ b/docs/0.5/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.5/integration-with-existing-apps.html b/docs/0.5/integration-with-existing-apps.html index 3d021074fb0..bd152e43b49 100644 --- a/docs/0.5/integration-with-existing-apps.html +++ b/docs/0.5/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.5/integration-with-existing-apps/index.html b/docs/0.5/integration-with-existing-apps/index.html index 3d021074fb0..bd152e43b49 100644 --- a/docs/0.5/integration-with-existing-apps/index.html +++ b/docs/0.5/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.5/javascript-environment.html b/docs/0.5/javascript-environment.html index 6923619741c..9371b73db15 100644 --- a/docs/0.5/javascript-environment.html +++ b/docs/0.5/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.5/javascript-environment/index.html b/docs/0.5/javascript-environment/index.html index 6923619741c..9371b73db15 100644 --- a/docs/0.5/javascript-environment/index.html +++ b/docs/0.5/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.5/native-components-ios.html b/docs/0.5/native-components-ios.html index 3c0af5c86ae..b6b3699619d 100644 --- a/docs/0.5/native-components-ios.html +++ b/docs/0.5/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.5/native-components-ios/index.html b/docs/0.5/native-components-ios/index.html index 3c0af5c86ae..b6b3699619d 100644 --- a/docs/0.5/native-components-ios/index.html +++ b/docs/0.5/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.5/native-modules-android.html b/docs/0.5/native-modules-android.html index acb5a0eefb6..50735d0198d 100644 --- a/docs/0.5/native-modules-android.html +++ b/docs/0.5/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.5/native-modules-android/index.html b/docs/0.5/native-modules-android/index.html index acb5a0eefb6..50735d0198d 100644 --- a/docs/0.5/native-modules-android/index.html +++ b/docs/0.5/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.5/native-modules-ios.html b/docs/0.5/native-modules-ios.html index f9829107892..aceceb8b07d 100644 --- a/docs/0.5/native-modules-ios.html +++ b/docs/0.5/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.5/performance/index.html b/docs/0.5/performance/index.html index b1e5862e972..cdcdf958ab5 100644 --- a/docs/0.5/performance/index.html +++ b/docs/0.5/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.50/getting-started.html b/docs/0.50/getting-started.html index 82ab089b75a..da12b39bf43 100644 --- a/docs/0.50/getting-started.html +++ b/docs/0.50/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.50/getting-started/index.html b/docs/0.50/getting-started/index.html index 82ab089b75a..da12b39bf43 100644 --- a/docs/0.50/getting-started/index.html +++ b/docs/0.50/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.50/integration-with-existing-apps.html b/docs/0.50/integration-with-existing-apps.html index 8538e384ebd..f446c8fd03c 100644 --- a/docs/0.50/integration-with-existing-apps.html +++ b/docs/0.50/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.50/integration-with-existing-apps/index.html b/docs/0.50/integration-with-existing-apps/index.html index 8538e384ebd..f446c8fd03c 100644 --- a/docs/0.50/integration-with-existing-apps/index.html +++ b/docs/0.50/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.50/javascript-environment.html b/docs/0.50/javascript-environment.html index 5dfc35a8d88..481c82084b0 100644 --- a/docs/0.50/javascript-environment.html +++ b/docs/0.50/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.50/javascript-environment/index.html b/docs/0.50/javascript-environment/index.html index 5dfc35a8d88..481c82084b0 100644 --- a/docs/0.50/javascript-environment/index.html +++ b/docs/0.50/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.50/native-components-ios.html b/docs/0.50/native-components-ios.html index 8202f640503..01def60d031 100644 --- a/docs/0.50/native-components-ios.html +++ b/docs/0.50/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.50/native-components-ios/index.html b/docs/0.50/native-components-ios/index.html index 8202f640503..01def60d031 100644 --- a/docs/0.50/native-components-ios/index.html +++ b/docs/0.50/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.50/native-modules-android.html b/docs/0.50/native-modules-android.html index 64fea135e6a..7021bae1519 100644 --- a/docs/0.50/native-modules-android.html +++ b/docs/0.50/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.50/native-modules-android/index.html b/docs/0.50/native-modules-android/index.html index 64fea135e6a..7021bae1519 100644 --- a/docs/0.50/native-modules-android/index.html +++ b/docs/0.50/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.50/native-modules-ios.html b/docs/0.50/native-modules-ios.html index 145c09df5ee..38405fcaecb 100644 --- a/docs/0.50/native-modules-ios.html +++ b/docs/0.50/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.50/performance/index.html b/docs/0.50/performance/index.html index 696d9f836a7..88e7d70cbf7 100644 --- a/docs/0.50/performance/index.html +++ b/docs/0.50/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.51/getting-started.html b/docs/0.51/getting-started.html index f364f98afa2..f65b69cc41a 100644 --- a/docs/0.51/getting-started.html +++ b/docs/0.51/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.51/getting-started/index.html b/docs/0.51/getting-started/index.html index f364f98afa2..f65b69cc41a 100644 --- a/docs/0.51/getting-started/index.html +++ b/docs/0.51/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.51/integration-with-existing-apps.html b/docs/0.51/integration-with-existing-apps.html index a1e5b6b2ab7..c6d96beae89 100644 --- a/docs/0.51/integration-with-existing-apps.html +++ b/docs/0.51/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.51/integration-with-existing-apps/index.html b/docs/0.51/integration-with-existing-apps/index.html index a1e5b6b2ab7..c6d96beae89 100644 --- a/docs/0.51/integration-with-existing-apps/index.html +++ b/docs/0.51/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.51/javascript-environment.html b/docs/0.51/javascript-environment.html index bd19fafa9b3..b5247dbefe1 100644 --- a/docs/0.51/javascript-environment.html +++ b/docs/0.51/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.51/javascript-environment/index.html b/docs/0.51/javascript-environment/index.html index bd19fafa9b3..b5247dbefe1 100644 --- a/docs/0.51/javascript-environment/index.html +++ b/docs/0.51/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.51/native-components-ios.html b/docs/0.51/native-components-ios.html index 35d32f98dfa..43102cb40f2 100644 --- a/docs/0.51/native-components-ios.html +++ b/docs/0.51/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.51/native-components-ios/index.html b/docs/0.51/native-components-ios/index.html index 35d32f98dfa..43102cb40f2 100644 --- a/docs/0.51/native-components-ios/index.html +++ b/docs/0.51/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.51/native-modules-android.html b/docs/0.51/native-modules-android.html index 3e0761aa045..5d5c198bb4a 100644 --- a/docs/0.51/native-modules-android.html +++ b/docs/0.51/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.51/native-modules-android/index.html b/docs/0.51/native-modules-android/index.html index 3e0761aa045..5d5c198bb4a 100644 --- a/docs/0.51/native-modules-android/index.html +++ b/docs/0.51/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.51/native-modules-ios.html b/docs/0.51/native-modules-ios.html index 9ad432c8fb9..41c30d3ef8c 100644 --- a/docs/0.51/native-modules-ios.html +++ b/docs/0.51/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.51/performance/index.html b/docs/0.51/performance/index.html index a589dfe6df9..92910d9e87a 100644 --- a/docs/0.51/performance/index.html +++ b/docs/0.51/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.52/getting-started.html b/docs/0.52/getting-started.html index 16ce8624829..e39d18d31ad 100644 --- a/docs/0.52/getting-started.html +++ b/docs/0.52/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.52/getting-started/index.html b/docs/0.52/getting-started/index.html index 16ce8624829..e39d18d31ad 100644 --- a/docs/0.52/getting-started/index.html +++ b/docs/0.52/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.52/integration-with-existing-apps.html b/docs/0.52/integration-with-existing-apps.html index 141804d255e..48460c0d1fb 100644 --- a/docs/0.52/integration-with-existing-apps.html +++ b/docs/0.52/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.52/integration-with-existing-apps/index.html b/docs/0.52/integration-with-existing-apps/index.html index 141804d255e..48460c0d1fb 100644 --- a/docs/0.52/integration-with-existing-apps/index.html +++ b/docs/0.52/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.52/javascript-environment.html b/docs/0.52/javascript-environment.html index 9304112cd1f..ade5b75de1b 100644 --- a/docs/0.52/javascript-environment.html +++ b/docs/0.52/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.52/javascript-environment/index.html b/docs/0.52/javascript-environment/index.html index 9304112cd1f..ade5b75de1b 100644 --- a/docs/0.52/javascript-environment/index.html +++ b/docs/0.52/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.52/native-components-ios.html b/docs/0.52/native-components-ios.html index 00aab0547d6..5748a6e6fc2 100644 --- a/docs/0.52/native-components-ios.html +++ b/docs/0.52/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.52/native-components-ios/index.html b/docs/0.52/native-components-ios/index.html index 00aab0547d6..5748a6e6fc2 100644 --- a/docs/0.52/native-components-ios/index.html +++ b/docs/0.52/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.52/native-modules-android.html b/docs/0.52/native-modules-android.html index da5f5e05828..51adf049f80 100644 --- a/docs/0.52/native-modules-android.html +++ b/docs/0.52/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.52/native-modules-android/index.html b/docs/0.52/native-modules-android/index.html index da5f5e05828..51adf049f80 100644 --- a/docs/0.52/native-modules-android/index.html +++ b/docs/0.52/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.52/native-modules-ios.html b/docs/0.52/native-modules-ios.html index 136372c0fca..5eeb5206db3 100644 --- a/docs/0.52/native-modules-ios.html +++ b/docs/0.52/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.52/performance/index.html b/docs/0.52/performance/index.html index 3440fd6f5f8..0140d0295cf 100644 --- a/docs/0.52/performance/index.html +++ b/docs/0.52/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.53/getting-started.html b/docs/0.53/getting-started.html index 9813c6e8931..2667b8e34a3 100644 --- a/docs/0.53/getting-started.html +++ b/docs/0.53/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.53/getting-started/index.html b/docs/0.53/getting-started/index.html index 9813c6e8931..2667b8e34a3 100644 --- a/docs/0.53/getting-started/index.html +++ b/docs/0.53/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.53/integration-with-existing-apps.html b/docs/0.53/integration-with-existing-apps.html index eb7f6891668..0bd683a9caf 100644 --- a/docs/0.53/integration-with-existing-apps.html +++ b/docs/0.53/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.53/integration-with-existing-apps/index.html b/docs/0.53/integration-with-existing-apps/index.html index eb7f6891668..0bd683a9caf 100644 --- a/docs/0.53/integration-with-existing-apps/index.html +++ b/docs/0.53/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.53/javascript-environment.html b/docs/0.53/javascript-environment.html index 095b3e7c34e..3cff516b617 100644 --- a/docs/0.53/javascript-environment.html +++ b/docs/0.53/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.53/javascript-environment/index.html b/docs/0.53/javascript-environment/index.html index 095b3e7c34e..3cff516b617 100644 --- a/docs/0.53/javascript-environment/index.html +++ b/docs/0.53/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.53/native-components-ios.html b/docs/0.53/native-components-ios.html index 488aaa6a96b..3900fbee34f 100644 --- a/docs/0.53/native-components-ios.html +++ b/docs/0.53/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.53/native-components-ios/index.html b/docs/0.53/native-components-ios/index.html index 488aaa6a96b..3900fbee34f 100644 --- a/docs/0.53/native-components-ios/index.html +++ b/docs/0.53/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.53/native-modules-android.html b/docs/0.53/native-modules-android.html index 42dee0844c5..dc0e8499672 100644 --- a/docs/0.53/native-modules-android.html +++ b/docs/0.53/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.53/native-modules-android/index.html b/docs/0.53/native-modules-android/index.html index 42dee0844c5..dc0e8499672 100644 --- a/docs/0.53/native-modules-android/index.html +++ b/docs/0.53/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.53/native-modules-ios.html b/docs/0.53/native-modules-ios.html index 5885e10ba88..71ad8a833aa 100644 --- a/docs/0.53/native-modules-ios.html +++ b/docs/0.53/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.53/performance/index.html b/docs/0.53/performance/index.html index 3e0342b3117..80e7a99783f 100644 --- a/docs/0.53/performance/index.html +++ b/docs/0.53/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.54/getting-started.html b/docs/0.54/getting-started.html index 5149eef4c24..b35d24cb96e 100644 --- a/docs/0.54/getting-started.html +++ b/docs/0.54/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.54/getting-started/index.html b/docs/0.54/getting-started/index.html index 5149eef4c24..b35d24cb96e 100644 --- a/docs/0.54/getting-started/index.html +++ b/docs/0.54/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.54/integration-with-existing-apps.html b/docs/0.54/integration-with-existing-apps.html index 63c4c5fdb46..05bb947db16 100644 --- a/docs/0.54/integration-with-existing-apps.html +++ b/docs/0.54/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.54/integration-with-existing-apps/index.html b/docs/0.54/integration-with-existing-apps/index.html index 63c4c5fdb46..05bb947db16 100644 --- a/docs/0.54/integration-with-existing-apps/index.html +++ b/docs/0.54/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.54/javascript-environment.html b/docs/0.54/javascript-environment.html index 91264351074..05f1721f0f1 100644 --- a/docs/0.54/javascript-environment.html +++ b/docs/0.54/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.54/javascript-environment/index.html b/docs/0.54/javascript-environment/index.html index 91264351074..05f1721f0f1 100644 --- a/docs/0.54/javascript-environment/index.html +++ b/docs/0.54/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.54/native-components-ios.html b/docs/0.54/native-components-ios.html index 70aa404e4de..757882f427f 100644 --- a/docs/0.54/native-components-ios.html +++ b/docs/0.54/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.54/native-components-ios/index.html b/docs/0.54/native-components-ios/index.html index 70aa404e4de..757882f427f 100644 --- a/docs/0.54/native-components-ios/index.html +++ b/docs/0.54/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.54/native-modules-android.html b/docs/0.54/native-modules-android.html index 96d7c7ecc8a..b81570b6067 100644 --- a/docs/0.54/native-modules-android.html +++ b/docs/0.54/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.54/native-modules-android/index.html b/docs/0.54/native-modules-android/index.html index 96d7c7ecc8a..b81570b6067 100644 --- a/docs/0.54/native-modules-android/index.html +++ b/docs/0.54/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.54/native-modules-ios.html b/docs/0.54/native-modules-ios.html index 4630ce632ef..a970fda5c0f 100644 --- a/docs/0.54/native-modules-ios.html +++ b/docs/0.54/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.54/performance/index.html b/docs/0.54/performance/index.html index 2c71bf982eb..dd929deca6a 100644 --- a/docs/0.54/performance/index.html +++ b/docs/0.54/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.55/getting-started.html b/docs/0.55/getting-started.html index 567cec337dd..ee63a8efd37 100644 --- a/docs/0.55/getting-started.html +++ b/docs/0.55/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.55/getting-started/index.html b/docs/0.55/getting-started/index.html index 567cec337dd..ee63a8efd37 100644 --- a/docs/0.55/getting-started/index.html +++ b/docs/0.55/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.55/integration-with-existing-apps.html b/docs/0.55/integration-with-existing-apps.html index b1c81ef5656..3f0574f1a94 100644 --- a/docs/0.55/integration-with-existing-apps.html +++ b/docs/0.55/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.55/integration-with-existing-apps/index.html b/docs/0.55/integration-with-existing-apps/index.html index b1c81ef5656..3f0574f1a94 100644 --- a/docs/0.55/integration-with-existing-apps/index.html +++ b/docs/0.55/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.55/javascript-environment.html b/docs/0.55/javascript-environment.html index 83d01d3b5b4..fe2bbfd6b40 100644 --- a/docs/0.55/javascript-environment.html +++ b/docs/0.55/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.55/javascript-environment/index.html b/docs/0.55/javascript-environment/index.html index 83d01d3b5b4..fe2bbfd6b40 100644 --- a/docs/0.55/javascript-environment/index.html +++ b/docs/0.55/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.55/native-components-ios.html b/docs/0.55/native-components-ios.html index c4f66c2af49..8b9c9f75366 100644 --- a/docs/0.55/native-components-ios.html +++ b/docs/0.55/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.55/native-components-ios/index.html b/docs/0.55/native-components-ios/index.html index c4f66c2af49..8b9c9f75366 100644 --- a/docs/0.55/native-components-ios/index.html +++ b/docs/0.55/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.55/native-modules-android.html b/docs/0.55/native-modules-android.html index ed333023ca2..5db1dfe3382 100644 --- a/docs/0.55/native-modules-android.html +++ b/docs/0.55/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.55/native-modules-android/index.html b/docs/0.55/native-modules-android/index.html index ed333023ca2..5db1dfe3382 100644 --- a/docs/0.55/native-modules-android/index.html +++ b/docs/0.55/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.55/native-modules-ios.html b/docs/0.55/native-modules-ios.html index 1fc128c3c12..edf329daeea 100644 --- a/docs/0.55/native-modules-ios.html +++ b/docs/0.55/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.55/performance/index.html b/docs/0.55/performance/index.html index 9c74feafb9c..7bcdf77ae01 100644 --- a/docs/0.55/performance/index.html +++ b/docs/0.55/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.56/getting-started.html b/docs/0.56/getting-started.html index abb3b7fe395..96969938a38 100644 --- a/docs/0.56/getting-started.html +++ b/docs/0.56/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.56/getting-started/index.html b/docs/0.56/getting-started/index.html index abb3b7fe395..96969938a38 100644 --- a/docs/0.56/getting-started/index.html +++ b/docs/0.56/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.56/integration-with-existing-apps.html b/docs/0.56/integration-with-existing-apps.html index fd638cdc295..a6f303bac32 100644 --- a/docs/0.56/integration-with-existing-apps.html +++ b/docs/0.56/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.56/integration-with-existing-apps/index.html b/docs/0.56/integration-with-existing-apps/index.html index fd638cdc295..a6f303bac32 100644 --- a/docs/0.56/integration-with-existing-apps/index.html +++ b/docs/0.56/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.56/javascript-environment.html b/docs/0.56/javascript-environment.html index 66e2537027d..d9afae6b5af 100644 --- a/docs/0.56/javascript-environment.html +++ b/docs/0.56/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.56/javascript-environment/index.html b/docs/0.56/javascript-environment/index.html index 66e2537027d..d9afae6b5af 100644 --- a/docs/0.56/javascript-environment/index.html +++ b/docs/0.56/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.56/native-components-ios.html b/docs/0.56/native-components-ios.html index eda63c1a4c4..a6b81f94b15 100644 --- a/docs/0.56/native-components-ios.html +++ b/docs/0.56/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.56/native-components-ios/index.html b/docs/0.56/native-components-ios/index.html index eda63c1a4c4..a6b81f94b15 100644 --- a/docs/0.56/native-components-ios/index.html +++ b/docs/0.56/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.56/native-modules-android.html b/docs/0.56/native-modules-android.html index 5c8effb3f12..698a449a97e 100644 --- a/docs/0.56/native-modules-android.html +++ b/docs/0.56/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.56/native-modules-android/index.html b/docs/0.56/native-modules-android/index.html index 5c8effb3f12..698a449a97e 100644 --- a/docs/0.56/native-modules-android/index.html +++ b/docs/0.56/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.56/native-modules-ios.html b/docs/0.56/native-modules-ios.html index 6f6def909c4..d50edbf8d14 100644 --- a/docs/0.56/native-modules-ios.html +++ b/docs/0.56/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.56/performance/index.html b/docs/0.56/performance/index.html index 57e9ac9f548..7c50cdefb75 100644 --- a/docs/0.56/performance/index.html +++ b/docs/0.56/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.57/getting-started.html b/docs/0.57/getting-started.html index e8beca32c1b..b18d2935d10 100644 --- a/docs/0.57/getting-started.html +++ b/docs/0.57/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.57/getting-started/index.html b/docs/0.57/getting-started/index.html index e8beca32c1b..b18d2935d10 100644 --- a/docs/0.57/getting-started/index.html +++ b/docs/0.57/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.57/integration-with-existing-apps.html b/docs/0.57/integration-with-existing-apps.html index 90c7c1879be..9ff83f76db1 100644 --- a/docs/0.57/integration-with-existing-apps.html +++ b/docs/0.57/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.57/integration-with-existing-apps/index.html b/docs/0.57/integration-with-existing-apps/index.html index 90c7c1879be..9ff83f76db1 100644 --- a/docs/0.57/integration-with-existing-apps/index.html +++ b/docs/0.57/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.57/javascript-environment.html b/docs/0.57/javascript-environment.html index e2b54ddcf4c..528fd6ed661 100644 --- a/docs/0.57/javascript-environment.html +++ b/docs/0.57/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.57/javascript-environment/index.html b/docs/0.57/javascript-environment/index.html index e2b54ddcf4c..528fd6ed661 100644 --- a/docs/0.57/javascript-environment/index.html +++ b/docs/0.57/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.57/native-components-ios.html b/docs/0.57/native-components-ios.html index d6bdedd3cbe..9593caf7aa8 100644 --- a/docs/0.57/native-components-ios.html +++ b/docs/0.57/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.57/native-components-ios/index.html b/docs/0.57/native-components-ios/index.html index d6bdedd3cbe..9593caf7aa8 100644 --- a/docs/0.57/native-components-ios/index.html +++ b/docs/0.57/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.57/native-modules-android.html b/docs/0.57/native-modules-android.html index dc6ebe45f28..25343aeb315 100644 --- a/docs/0.57/native-modules-android.html +++ b/docs/0.57/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.57/native-modules-android/index.html b/docs/0.57/native-modules-android/index.html index dc6ebe45f28..25343aeb315 100644 --- a/docs/0.57/native-modules-android/index.html +++ b/docs/0.57/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.57/native-modules-ios.html b/docs/0.57/native-modules-ios.html index 6690e8d0666..53e68e5b628 100644 --- a/docs/0.57/native-modules-ios.html +++ b/docs/0.57/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.57/performance/index.html b/docs/0.57/performance/index.html index 8aead58bc92..b0caf8015c2 100644 --- a/docs/0.57/performance/index.html +++ b/docs/0.57/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.58/getting-started.html b/docs/0.58/getting-started.html index f8de1c53155..b425207f969 100644 --- a/docs/0.58/getting-started.html +++ b/docs/0.58/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.58/getting-started/index.html b/docs/0.58/getting-started/index.html index f8de1c53155..b425207f969 100644 --- a/docs/0.58/getting-started/index.html +++ b/docs/0.58/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.58/integration-with-existing-apps.html b/docs/0.58/integration-with-existing-apps.html index 318795f0f4f..0f38ebec58e 100644 --- a/docs/0.58/integration-with-existing-apps.html +++ b/docs/0.58/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.58/integration-with-existing-apps/index.html b/docs/0.58/integration-with-existing-apps/index.html index 318795f0f4f..0f38ebec58e 100644 --- a/docs/0.58/integration-with-existing-apps/index.html +++ b/docs/0.58/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.58/javascript-environment.html b/docs/0.58/javascript-environment.html index 75572095175..5584fb20e49 100644 --- a/docs/0.58/javascript-environment.html +++ b/docs/0.58/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.58/javascript-environment/index.html b/docs/0.58/javascript-environment/index.html index 75572095175..5584fb20e49 100644 --- a/docs/0.58/javascript-environment/index.html +++ b/docs/0.58/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.58/native-components-ios.html b/docs/0.58/native-components-ios.html index 27ea3e3e7b3..b11ce2f47ef 100644 --- a/docs/0.58/native-components-ios.html +++ b/docs/0.58/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.58/native-components-ios/index.html b/docs/0.58/native-components-ios/index.html index 27ea3e3e7b3..b11ce2f47ef 100644 --- a/docs/0.58/native-components-ios/index.html +++ b/docs/0.58/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.58/native-modules-android.html b/docs/0.58/native-modules-android.html index b1eec2fac28..c82e26b3b8d 100644 --- a/docs/0.58/native-modules-android.html +++ b/docs/0.58/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.58/native-modules-android/index.html b/docs/0.58/native-modules-android/index.html index b1eec2fac28..c82e26b3b8d 100644 --- a/docs/0.58/native-modules-android/index.html +++ b/docs/0.58/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.58/native-modules-ios.html b/docs/0.58/native-modules-ios.html index 448a5cf8c64..40756a08552 100644 --- a/docs/0.58/native-modules-ios.html +++ b/docs/0.58/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.58/performance/index.html b/docs/0.58/performance/index.html index 9a5cdd51007..e438b6e098d 100644 --- a/docs/0.58/performance/index.html +++ b/docs/0.58/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.6/getting-started.html b/docs/0.6/getting-started.html index be52dfe50ad..7d617de2f91 100644 --- a/docs/0.6/getting-started.html +++ b/docs/0.6/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.6/getting-started/index.html b/docs/0.6/getting-started/index.html index be52dfe50ad..7d617de2f91 100644 --- a/docs/0.6/getting-started/index.html +++ b/docs/0.6/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.6/integration-with-existing-apps.html b/docs/0.6/integration-with-existing-apps.html index 4ae880c4455..06a1ebea6df 100644 --- a/docs/0.6/integration-with-existing-apps.html +++ b/docs/0.6/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.6/integration-with-existing-apps/index.html b/docs/0.6/integration-with-existing-apps/index.html index 4ae880c4455..06a1ebea6df 100644 --- a/docs/0.6/integration-with-existing-apps/index.html +++ b/docs/0.6/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.6/javascript-environment.html b/docs/0.6/javascript-environment.html index 4621945d8a5..1e17c4a0356 100644 --- a/docs/0.6/javascript-environment.html +++ b/docs/0.6/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.6/javascript-environment/index.html b/docs/0.6/javascript-environment/index.html index 4621945d8a5..1e17c4a0356 100644 --- a/docs/0.6/javascript-environment/index.html +++ b/docs/0.6/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.6/native-components-ios.html b/docs/0.6/native-components-ios.html index 68ad5e8e478..4c56198a4ec 100644 --- a/docs/0.6/native-components-ios.html +++ b/docs/0.6/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.6/native-components-ios/index.html b/docs/0.6/native-components-ios/index.html index 68ad5e8e478..4c56198a4ec 100644 --- a/docs/0.6/native-components-ios/index.html +++ b/docs/0.6/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.6/native-modules-android.html b/docs/0.6/native-modules-android.html index 266df8c3f08..8d6e0ae204a 100644 --- a/docs/0.6/native-modules-android.html +++ b/docs/0.6/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.6/native-modules-android/index.html b/docs/0.6/native-modules-android/index.html index 266df8c3f08..8d6e0ae204a 100644 --- a/docs/0.6/native-modules-android/index.html +++ b/docs/0.6/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.6/native-modules-ios.html b/docs/0.6/native-modules-ios.html index 3b985f50e6d..d160aeff6b2 100644 --- a/docs/0.6/native-modules-ios.html +++ b/docs/0.6/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.6/performance/index.html b/docs/0.6/performance/index.html index a0b854313b1..7744314797f 100644 --- a/docs/0.6/performance/index.html +++ b/docs/0.6/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.7/getting-started.html b/docs/0.7/getting-started.html index 3f4859aebd7..4aaf6dbc005 100644 --- a/docs/0.7/getting-started.html +++ b/docs/0.7/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.7/getting-started/index.html b/docs/0.7/getting-started/index.html index 3f4859aebd7..4aaf6dbc005 100644 --- a/docs/0.7/getting-started/index.html +++ b/docs/0.7/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.7/integration-with-existing-apps.html b/docs/0.7/integration-with-existing-apps.html index 845653763f1..ddd720fdcf6 100644 --- a/docs/0.7/integration-with-existing-apps.html +++ b/docs/0.7/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.7/integration-with-existing-apps/index.html b/docs/0.7/integration-with-existing-apps/index.html index 845653763f1..ddd720fdcf6 100644 --- a/docs/0.7/integration-with-existing-apps/index.html +++ b/docs/0.7/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.7/javascript-environment.html b/docs/0.7/javascript-environment.html index 8674deca25b..2c4e1c73c17 100644 --- a/docs/0.7/javascript-environment.html +++ b/docs/0.7/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.7/javascript-environment/index.html b/docs/0.7/javascript-environment/index.html index 8674deca25b..2c4e1c73c17 100644 --- a/docs/0.7/javascript-environment/index.html +++ b/docs/0.7/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.7/native-components-ios.html b/docs/0.7/native-components-ios.html index 850b4a7271d..340e930f26d 100644 --- a/docs/0.7/native-components-ios.html +++ b/docs/0.7/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.7/native-components-ios/index.html b/docs/0.7/native-components-ios/index.html index 850b4a7271d..340e930f26d 100644 --- a/docs/0.7/native-components-ios/index.html +++ b/docs/0.7/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.7/native-modules-android.html b/docs/0.7/native-modules-android.html index 71726af53b1..b23e212c78b 100644 --- a/docs/0.7/native-modules-android.html +++ b/docs/0.7/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.7/native-modules-android/index.html b/docs/0.7/native-modules-android/index.html index 71726af53b1..b23e212c78b 100644 --- a/docs/0.7/native-modules-android/index.html +++ b/docs/0.7/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.7/native-modules-ios.html b/docs/0.7/native-modules-ios.html index 7d260628dd3..fa3cf62ac68 100644 --- a/docs/0.7/native-modules-ios.html +++ b/docs/0.7/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.7/performance/index.html b/docs/0.7/performance/index.html index fb8ffd9a9b6..349df8a4cc4 100644 --- a/docs/0.7/performance/index.html +++ b/docs/0.7/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.8/getting-started.html b/docs/0.8/getting-started.html index 00fc0426054..9f290df6e8b 100644 --- a/docs/0.8/getting-started.html +++ b/docs/0.8/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.8/getting-started/index.html b/docs/0.8/getting-started/index.html index 00fc0426054..9f290df6e8b 100644 --- a/docs/0.8/getting-started/index.html +++ b/docs/0.8/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.8/integration-with-existing-apps.html b/docs/0.8/integration-with-existing-apps.html index d86df829fd7..799bbdb7a30 100644 --- a/docs/0.8/integration-with-existing-apps.html +++ b/docs/0.8/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.8/integration-with-existing-apps/index.html b/docs/0.8/integration-with-existing-apps/index.html index d86df829fd7..799bbdb7a30 100644 --- a/docs/0.8/integration-with-existing-apps/index.html +++ b/docs/0.8/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.8/javascript-environment.html b/docs/0.8/javascript-environment.html index facffa7cd10..60d275cb5b0 100644 --- a/docs/0.8/javascript-environment.html +++ b/docs/0.8/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.8/javascript-environment/index.html b/docs/0.8/javascript-environment/index.html index facffa7cd10..60d275cb5b0 100644 --- a/docs/0.8/javascript-environment/index.html +++ b/docs/0.8/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.8/native-components-ios.html b/docs/0.8/native-components-ios.html index 552379d2535..2b60c9b2bed 100644 --- a/docs/0.8/native-components-ios.html +++ b/docs/0.8/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.8/native-components-ios/index.html b/docs/0.8/native-components-ios/index.html index 552379d2535..2b60c9b2bed 100644 --- a/docs/0.8/native-components-ios/index.html +++ b/docs/0.8/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.8/native-modules-android.html b/docs/0.8/native-modules-android.html index d3e56957cac..4d01356183c 100644 --- a/docs/0.8/native-modules-android.html +++ b/docs/0.8/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.8/native-modules-android/index.html b/docs/0.8/native-modules-android/index.html index d3e56957cac..4d01356183c 100644 --- a/docs/0.8/native-modules-android/index.html +++ b/docs/0.8/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.8/native-modules-ios.html b/docs/0.8/native-modules-ios.html index 554f8977d88..702f6101c9c 100644 --- a/docs/0.8/native-modules-ios.html +++ b/docs/0.8/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.8/performance/index.html b/docs/0.8/performance/index.html index 57ca06f8799..4c7e421e89f 100644 --- a/docs/0.8/performance/index.html +++ b/docs/0.8/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.9/getting-started.html b/docs/0.9/getting-started.html index fe7928e8a10..fbd46151e4c 100644 --- a/docs/0.9/getting-started.html +++ b/docs/0.9/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.9/getting-started/index.html b/docs/0.9/getting-started/index.html index fe7928e8a10..fbd46151e4c 100644 --- a/docs/0.9/getting-started/index.html +++ b/docs/0.9/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/0.9/integration-with-existing-apps.html b/docs/0.9/integration-with-existing-apps.html index 38158cc3142..19690b294d5 100644 --- a/docs/0.9/integration-with-existing-apps.html +++ b/docs/0.9/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.9/integration-with-existing-apps/index.html b/docs/0.9/integration-with-existing-apps/index.html index 38158cc3142..19690b294d5 100644 --- a/docs/0.9/integration-with-existing-apps/index.html +++ b/docs/0.9/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/0.9/javascript-environment.html b/docs/0.9/javascript-environment.html index 1f3f255f64a..4628d4c07f6 100644 --- a/docs/0.9/javascript-environment.html +++ b/docs/0.9/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.9/javascript-environment/index.html b/docs/0.9/javascript-environment/index.html index 1f3f255f64a..4628d4c07f6 100644 --- a/docs/0.9/javascript-environment/index.html +++ b/docs/0.9/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/0.9/native-components-ios.html b/docs/0.9/native-components-ios.html index 641b5bc878b..51d7917d1c4 100644 --- a/docs/0.9/native-components-ios.html +++ b/docs/0.9/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.9/native-components-ios/index.html b/docs/0.9/native-components-ios/index.html index 641b5bc878b..51d7917d1c4 100644 --- a/docs/0.9/native-components-ios/index.html +++ b/docs/0.9/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/0.9/native-modules-android.html b/docs/0.9/native-modules-android.html index 9ccfc9f8455..ebd9d40b1ba 100644 --- a/docs/0.9/native-modules-android.html +++ b/docs/0.9/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.9/native-modules-android/index.html b/docs/0.9/native-modules-android/index.html index 9ccfc9f8455..ebd9d40b1ba 100644 --- a/docs/0.9/native-modules-android/index.html +++ b/docs/0.9/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/0.9/native-modules-ios.html b/docs/0.9/native-modules-ios.html index 8e4b1c65fa8..2ce890d534f 100644 --- a/docs/0.9/native-modules-ios.html +++ b/docs/0.9/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/0.9/performance/index.html b/docs/0.9/performance/index.html index ea2ca8454e0..a0f853b873d 100644 --- a/docs/0.9/performance/index.html +++ b/docs/0.9/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/getting-started.html b/docs/getting-started.html index 0ed50731a2d..09bcc42a6d2 100644 --- a/docs/getting-started.html +++ b/docs/getting-started.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html index 0ed50731a2d..09bcc42a6d2 100644 --- a/docs/getting-started/index.html +++ b/docs/getting-started/index.html @@ -333,12 +333,24 @@ npm start # you can also use: expo startreact-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Expo (or Create React Native App), or if you're adding iOS support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
Use the React Native command line interface to generate a new React Native project called "AwesomeProject":
react-native init AwesomeProject
This is not necessary if you are integrating React Native into an existing application, if you "ejected" from Create React Native App, or if you're adding Android support to an existing React Native project (see Platform Specific Code). You can also use a third-party CLI to init your React Native app, such as Ignite CLI.
+If you want to start a new project with a specifc React Native version, you can use the --version argument:
react-native init AwesomeProject --version X.XX.X
+
+react-native init AwesomeProject --version react-native@next
+
You will need an Android device to run your React Native Android app. This can be either a physical Android device, or more commonly, you can use an Android Virtual Device which allows you to emulate an Android device on your computer.
diff --git a/docs/integration-with-existing-apps.html b/docs/integration-with-existing-apps.html index 932a95fc2a5..9ae27277093 100644 --- a/docs/integration-with-existing-apps.html +++ b/docs/integration-with-existing-apps.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/integration-with-existing-apps/index.html b/docs/integration-with-existing-apps/index.html index 932a95fc2a5..9ae27277093 100644 --- a/docs/integration-with-existing-apps/index.html +++ b/docs/integration-with-existing-apps/index.html @@ -151,7 +151,7 @@ "version": "0.0.1", "private": true, "scripts": { - "start": "node node_modules/react-native/local-cli/cli.js start" + "start": "yarn react-native start" } } diff --git a/docs/javascript-environment.html b/docs/javascript-environment.html index bdc7c19f8d5..90f8e9331c9 100644 --- a/docs/javascript-environment.html +++ b/docs/javascript-environment.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/javascript-environment/index.html b/docs/javascript-environment/index.html index bdc7c19f8d5..90f8e9331c9 100644 --- a/docs/javascript-environment/index.html +++ b/docs/javascript-environment/index.html @@ -50,33 +50,37 @@ES6
<C onPress={() => this.setState({pressed: true})}<C onPress={() => this.setState({pressed: true})} />let greeting = 'hi';Math.max(...array);class C extends React.Component { render() { return <View />; } }const answer = 42;var {isActive, style} = this.props;for (var num of [1, 2, 3]) {}for (var num of [1, 2, 3]) {};import React, { Component } from 'react';var key = 'abc'; var obj = {[key]: 10};var obj = { method() { return 10; } };var name = 'vjeux'; var obj = { name };function(type, ...args) { }function(type, ...args) {};var who = 'world'; var str = `Hello ${who}`;ES8
function f(a, b, c,) { }async function doStuffAsync() { const foo = await doOtherStuffAsync(); };function f(a, b, c,) {};async function doStuffAsync() { const foo = await doOtherStuffAsync(); };Stage 3
var extended = { ...obj, a: 10 };Stage 1
+var name = obj.user?.name;Specific
<View style={{color: 'red'}} />function foo(x: ?number): string {}function foo(x: ?number): string {};Many standards functions are also available on all the supported JavaScript runtimes.
diff --git a/docs/native-components-ios.html b/docs/native-components-ios.html index cd2031bd520..545a1caf201 100644 --- a/docs/native-components-ios.html +++ b/docs/native-components-ios.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/native-components-ios/index.html b/docs/native-components-ios/index.html index cd2031bd520..545a1caf201 100644 --- a/docs/native-components-ios/index.html +++ b/docs/native-components-ios/index.html @@ -73,7 +73,7 @@ RCT_EXPORT_MODULE(RNTMap) import { requireNativeComponent } from 'react-native'; // requireNativeComponent automatically resolves 'RNTMap' to 'RNTMapManager' -module.exports = requireNativeComponent('RNTMap', null); +module.exports = requireNativeComponent('RNTMap'); // MyApp.js diff --git a/docs/native-modules-android.html b/docs/native-modules-android.html index e73788f39ec..4f234b155f5 100644 --- a/docs/native-modules-android.html +++ b/docs/native-modules-android.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/native-modules-android/index.html b/docs/native-modules-android/index.html index e73788f39ec..4f234b155f5 100644 --- a/docs/native-modules-android/index.html +++ b/docs/native-modules-android/index.html @@ -42,7 +42,7 @@This guide will use the Toast example. Let's say we would like to be able to create a toast message from JavaScript.
We start by creating a native module. A native module is a Java class that usually extends the ReactContextBaseJavaModule class and implements the functionality required by the JavaScript. Our goal here is to be able to write ToastExample.show('Awesome', ToastExample.SHORT); from JavaScript to display a short toast on the screen.
create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
Create a new Java Class named ToastModule.java inside android/app/src/main/java/com/your-app-name/ folder with the content below:
// ToastModule.java
package com.your-app-name;
@@ -150,6 +150,7 @@ ReadableArray -><
}
To make it simpler to access your new functionality from JavaScript, it is common to wrap the native module in a JavaScript module. This is not necessary but saves the consumers of your library the need to pull it off of NativeModules each time. This JavaScript file also becomes a good location for you to add any JavaScript side functionality.
Create a new JavaScript file named ToastExample.js with the content below:
/**
* This exposes the native ToastExample module as a JS module. This has a
* function 'show' which takes the following parameters:
@@ -166,6 +167,7 @@ module.exports .show('Awesome', ToastExample.SHORT);
+Please make sure this JavasScript file to be the same hierarchy as ToastExample.js.
Native modules also support a special kind of argument - a callback. In most cases it is used to provide the function call result to JavaScript.
diff --git a/docs/native-modules-ios.html b/docs/native-modules-ios.html index 0911c902fee..831ec81f9bb 100644 --- a/docs/native-modules-ios.html +++ b/docs/native-modules-ios.html @@ -254,6 +254,14 @@ RCTRootView *rootView = [[RCTRootView alloc]console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
console.log(CalendarManager.firstDayOfTheWeek);
Note that the constants are exported only at initialization time, so if you change constantsToExport values at runtime it won't affect the JavaScript environment.
+ requiresMainQueueSetupIf you override - constantsToExport then you should also implement + requiresMainQueueSetup to let React Native know if your module needs to be initialized on the main thread. Otherwise you will see a warning that in the future your module may be initialized on a background thread unless you explicitly opt out with + requiresMainQueueSetup:
+ (BOOL)requiresMainQueueSetup
+{
+ return YES; // only do this if your module initialization relies on calling UIKit!
+}
+
+If your module does not require access to UIKit, then you should respond to + requiresMainQueueSetup with NO.
Enums that are defined via NS_ENUM cannot be used as method arguments without first extending RCTConvert.
In order to export the following NS_ENUM definition:
Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports:
diff --git a/docs/performance/index.html b/docs/performance/index.html index 85683aa7176..2d115a8d4ec 100644 --- a/docs/performance/index.html +++ b/docs/performance/index.html @@ -285,7 +285,7 @@ module.exports = config; ]Finally, you can update "start" under "scripts" on your package.json to use the config:
-"start": "node node_modules/react-native/local-cli/cli.js start --config ../../../../packager/config.js",
"start": "yarn react-native start --config packager/config.js",
Start your package server with npm start. Note that when the dev packager is automatically launched via xcode and react-native run-android, etc, it does not use npm start, so it won't use the config.
In your root file (index.(ios|android).js) you can add the following after the initial imports: