You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/GettingStarted.md
+34-16Lines changed: 34 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -65,19 +65,25 @@ one to start with, since the setup is a bit different.
65
65
66
66
## Installing Dependencies
67
67
68
-
You will need Node.js, Watchman, the React Native command line interface, and Xcode.
68
+
You will need Node, Watchman, the React Native command line interface, and Xcode.
69
69
70
70
<blockclass="mac android" />
71
71
72
72
## Installing Dependencies
73
73
74
-
You will need Node.js, Watchman, the React Native command line interface, and Android Studio.
74
+
You will need Node, Watchman, the React Native command line interface, a JDK, and Android Studio.
75
75
76
-
<blockclass="windows linux android" />
76
+
<blockclass="linux android" />
77
77
78
78
## Installing Dependencies
79
79
80
-
You will need Node.js, the React Native command line interface, and Android Studio.
80
+
You will need Node, the React Native command line interface, a JDK, and Android Studio.
81
+
82
+
<blockclass="windows android" />
83
+
84
+
## Installing Dependencies
85
+
86
+
You will need Node, the React Native command line interface, Python2, a JDK, and Android Studio.
81
87
82
88
<blockclass="mac ios android" />
83
89
@@ -90,33 +96,41 @@ brew install node
90
96
brew install watchman
91
97
```
92
98
93
-
> [Watchman](https://facebook.github.io/watchman) is a tool by Facebook for watching
94
-
changes in the filesystem. It is highly recommended you install it for better performance.
99
+
If you have already installed Node on your system, make sure it is version 4 or newer.
100
+
101
+
[Watchman](https://facebook.github.io/watchman) is a tool by Facebook for watching changes in the filesystem. It is highly recommended you install it for better performance.
95
102
96
103
<blockclass="linux android" />
97
104
98
105
### Node
99
106
100
-
Follow the [installation instructions for your Linux distribution](https://nodejs.org/en/download/package-manager/) to install Node.js 4 or newer.
107
+
Follow the [installation instructions for your Linux distribution](https://nodejs.org/en/download/package-manager/) to install Node 4 or newer.
101
108
102
109
<blockclass='windows android' />
103
110
104
-
### Node
111
+
### Node, Python2, JDK
105
112
106
-
We recommend installing Node.js and Python2 via [Chocolatey](https://chocolatey.org), a popular package manager for Windows. Open a Command Prompt as Administrator, then run:
113
+
We recommend installing Node and Python2 via [Chocolatey](https://chocolatey.org), a popular package manager for Windows.
114
+
115
+
Android Studio, which we will install next, requires a recent version of the [Java SE Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html) which can be installed using Chocolatey.
116
+
117
+
Open a Command Prompt as Administrator, then run:
107
118
108
119
```
109
120
choco install nodejs.install
110
121
choco install python2
122
+
choco install jdk8
111
123
```
112
124
125
+
If you have already installed Node on your system, make sure it is version 4 or newer. If you already have a JDK on your system, make sure it is version 8 or newer.
126
+
113
127
> You can find additional installation options on [Node.js's Downloads page](https://nodejs.org/en/download/).
114
128
115
129
<blockclass="mac ios android" />
116
130
117
131
### The React Native CLI
118
132
119
-
Node.js comes with npm, which lets you install the React Native command line interface.
133
+
Node comes with npm, which lets you install the React Native command line interface.
The easiest way to install Xcode 8 is via the [Mac App Store](https://itunes.apple.com/us/app/xcode/id497799835?mt=12). Installing Xcode will also install the iOS Simulator and all the necessary tools to build your iOS app.
161
+
The easiest way to install Xcode is via the [Mac App Store](https://itunes.apple.com/us/app/xcode/id497799835?mt=12). Installing Xcode will also install the iOS Simulator and all the necessary tools to build your iOS app.
162
+
163
+
If you have already installed Xcode on your system, make sure it is version 8 or higher.
148
164
149
165
You will also need to install the Xcode Command Line Tools. Open Xcode, then choose "Preferences..." from the Xcode menu. Go to the Locations panel and install the tools by selecting the most recent version in the Command Line Tools dropdown.
150
166
@@ -156,13 +172,15 @@ You will also need to install the Xcode Command Line Tools. Open Xcode, then cho
156
172
157
173
Setting up your development environment can be somewhat tedious if you're new to Android development. If you're already familiar with Android development, there are a few things you may need to configure. In either case, please make sure to carefully follow the next few steps.
158
174
159
-
#### 1. Download and install Android Studio
175
+
<blockclass="mac linux android" />
160
176
161
-
[Android Studio](https://developer.android.com/studio/install.html) provides the Android SDK and AVD (emulator) required to run and test your React Native apps.
177
+
> Android Studio requires a recent version of the [Java SE Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html). Go ahead and install JDK 8 or newer if needed.
162
178
163
-
<blockclass="mac android" />
179
+
<blockclass="mac linux windows android" />
180
+
181
+
#### 1. Download and install Android Studio
164
182
165
-
> Android Studio requires a recent version of the [Java SE Development Kit (JDK)](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html).
183
+
Android Studio provides the Android SDK and AVD (emulator) required to run and test your React Native apps. [Download Android Studio](https://developer.android.com/studio/index.html), then follow the [installation instructions](https://developer.android.com/studio/install.html). Choose `Custom` installation when prompted by the Setup Wizard, and proceed to the next step.
Copy file name to clipboardExpand all lines: docs/NativeModulesAndroid.md
-54Lines changed: 0 additions & 54 deletions
Original file line number
Diff line number
Diff line change
@@ -283,60 +283,6 @@ measureLayout();
283
283
284
284
Native modules should not have any assumptions about what thread they are being called on, as the current assignment is subject to change in the future. If a blocking call is required, the heavy work should be dispatched to an internally managed worker thread, and any callbacks distributed from there.
285
285
286
-
### Sending Events to JavaScript
287
-
288
-
Native modules can signal events to JavaScript without being invoked directly. The easiest way to do this is to use the `RCTDeviceEventEmitter` which can be obtained from the `ReactContext` as in the code snippet below.
### Getting activity result from `startActivityForResult`
341
287
342
288
You'll need to listen to `onActivityResult` if you want to get results from an activity you started with `startActivityForResult`.Todothis, you must extend `BaseActivityEventListener` or implement `ActivityEventListener`.The former is preferred as it is more resilient to API changes. Then, you need to register the listener in the module's constructor,
Copy file name to clipboardExpand all lines: docs/Performance.md
+1-3Lines changed: 1 addition & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ The scroll events are dispatched to the JS thread, but their receipt is not nece
66
66
### Running in development mode (`dev=true`)
67
67
68
68
JavaScript thread performance suffers greatly when running in dev mode.
69
-
This is unavoidable: a lot more work needs to be done at runtime to provide you with good warnings and error messages, such as validating propTypes and various other assertions.
69
+
This is unavoidable: a lot more work needs to be done at runtime to provide you with good warnings and error messages, such as validating propTypes and various other assertions. Always make sure to test performance in [release builds](docs/running-on-device.html#building-your-app-for-production).
70
70
71
71
### Using `console.log` statements
72
72
@@ -80,8 +80,6 @@ Use the new [`FlatList`](docs/flatlist.html) or [`SectionList`](docs/sectionlist
80
80
Besides simplifying the API, the new list components also have significant performance enhancements,
81
81
the main one being nearly constant memory usage for any number of rows.
82
82
83
-
TODO: Link to blog post
84
-
85
83
### JS FPS plunges when re-rendering a view that hardly changes
86
84
87
85
If you are using a ListView, you must provide a `rowHasChanged` function that can reduce a lot of work by quickly determining whether or not a row needs to be re-rendered. If you are using immutable data structures, this would be as simple as a reference equality check.
Copy file name to clipboardExpand all lines: docs/Troubleshooting.md
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,15 @@ The React Native packager runs on port 8081. If another process is already using
16
16
17
17
Run the following command on a Mac to find the id for the process that is listening on port 8081:
18
18
19
-
`$ sudo lsof -i :8081`
19
+
```
20
+
$ sudo lsof -i :8081
21
+
```
20
22
21
23
Then run the following to terminate the process:
22
24
23
-
`$ kill -9 <PID>`
25
+
```
26
+
$ kill -9 <PID>
27
+
```
24
28
25
29
On Windows you can find the process using port 8081 using [Resource Monitor](https://stackoverflow.com/questions/48198/how-can-you-find-out-which-process-is-listening-on-a-port-on-windows) and stop it using Task Manager.
26
30
@@ -36,7 +40,7 @@ You will also need to update your applications to load the JavaScript bundle fro
36
40
37
41
### NPM locking error
38
42
39
-
If you encounter an error such as "npm WARN locking Error: EACCES" while using the React Native CLI, try running the following:
43
+
If you encounter an error such as `npm WARN locking Error: EACCES` while using the React Native CLI, try running the following:
40
44
41
45
```
42
46
sudo chown -R $USER ~/.npm
@@ -101,4 +105,3 @@ Issue caused by the number of directories [inotify](https://github.com/guard/lis
101
105
```
102
106
echo fs.inotify.max_user_watches=582222 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
0 commit comments