diff --git a/docs/contributing.md b/docs/contributing.md index 75783ae29122a5..3ef1a131d46293 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -96,11 +96,11 @@ Small pull requests are much easier to review and more likely to get merged. Mak Please make sure the following is done when submitting a pull request: -1. Fork [the repository](https://github.com/facebook/react-native) and create your branch from `master`. -2. Add the copyright notice to the top of any new files you've added. -3. Describe your [**test plan**](contributing.html#test-plan) in your pull request description. Make sure to [test your changes](testing.html)! -4. Make sure your code lints (`npm run lint`). -5. If you haven't already, [sign the CLA](https://code.facebook.com/cla). +1. Fork [the repository](https://github.com/facebook/react-native) and create your branch from `master`. +2. Add the copyright notice to the top of any new files you've added. +3. Describe your [**test plan**](contributing.html#test-plan) in your pull request description. Make sure to [test your changes](testing.html)! +4. Make sure your code lints (`npm run lint`). +5. If you haven't already, [sign the CLA](https://code.facebook.com/cla). All pull requests should be opened against the `master` branch. After opening your pull request, ensure [**all tests pass**](contributing.html#contrinuous-integration-tests) on Circle CI. If a test fails and you believe it is unrelated to your change, leave a comment on the pull request explaining why. diff --git a/docs/image.md b/docs/image.md index a3a49ad4e5425d..a1d2ef37fc6c84 100644 --- a/docs/image.md +++ b/docs/image.md @@ -424,7 +424,7 @@ Does not work for static image resources. | ------- | -------- | -------- | ---------------------------------------------------------------------------------------------------- | | uri | string | Yes | The location of the image. | | success | function | Yes | The function that will be called if the image was successfully found and width and height retrieved. | -| failure | function | No | The function that will be called if there was an error, such as failing to retrieve the image. | +| failure | function | No | The function that will be called if there was an error, such as failing to retrieve the image. | --- diff --git a/docs/keyboardavoidingview.md b/docs/keyboardavoidingview.md index 50d06bc596448b..f7b88d5ef0418d 100644 --- a/docs/keyboardavoidingview.md +++ b/docs/keyboardavoidingview.md @@ -74,9 +74,9 @@ The style of the content container(View) when behavior is 'position'. Enabled or disabled KeyboardAvoidingView. -| Type | Required | -| ---------- | -------- | -| boolean | Yes | +| Type | Required | +| ------- | -------- | +| boolean | Yes | ## Methods diff --git a/docs/performance.md b/docs/performance.md index b6a43ab74d6c02..bfacb97f6c3b57 100644 --- a/docs/performance.md +++ b/docs/performance.md @@ -103,7 +103,7 @@ handleOnPress() { As mentioned above, `Navigator` animations are controlled by the JavaScript thread. Imagine the "push from right" scene transition: each frame, the new scene is moved from the right to left, starting offscreen (let's say at an x-offset of 320) and ultimately settling when the scene sits at an x-offset of -0. Each frame during this transition, the JavaScript thread needs to send a new x-offset to the main thread. If the JavaScript thread is locked up, it cannot do this and so no update occurs on that frame and the animation stutters. +0. Each frame during this transition, the JavaScript thread needs to send a new x-offset to the main thread. If the JavaScript thread is locked up, it cannot do this and so no update occurs on that frame and the animation stutters. One solution to this is to allow for JavaScript-based animations to be offloaded to the main thread. If we were to do the same thing as in the above example with this approach, we might calculate a list of all x-offsets for the new scene when we are starting the transition and send them to the main thread to execute in an optimized way. Now that the JavaScript thread is freed of this responsibility, it's not a big deal if it drops a few frames while rendering the scene -- you probably won't even notice because you will be too distracted by the pretty transition. @@ -225,8 +225,8 @@ This doesn't seem right. Why is it being called so often? Are they actually diff If you identified a native UI problem, there are usually two scenarios: -1. the UI you're trying to draw each frame involves too much work on the GPU, or -2. You're constructing new UI during the animation/interaction (e.g. loading in new content during a scroll). +1. the UI you're trying to draw each frame involves too much work on the GPU, or +2. You're constructing new UI during the animation/interaction (e.g. loading in new content during a scroll). ##### Too much GPU work diff --git a/docs/running-on-device.md b/docs/running-on-device.md index a34756401cbc2f..43d27feb3d3245 100644 --- a/docs/running-on-device.md +++ b/docs/running-on-device.md @@ -316,13 +316,13 @@ Open a terminal and type `/sbin/ifconfig` to find your machine's IP address. -1. Make sure your laptop and your phone are on the **same** Wi-Fi network. -2. Open your React Native app on your device. -3. You'll see a [red screen with an error](debugging.md#in-app-errors-and-warnings). This is OK. The following steps will fix that. -4. Open the in-app [Developer menu](debugging.md#accessing-the-in-app-developer-menu). -5. Go to **Dev Settings** → **Debug server host & port for device**. -6. Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081). -7. Go back to the **Developer menu** and select **Reload JS**. +1. Make sure your laptop and your phone are on the **same** Wi-Fi network. +2. Open your React Native app on your device. +3. You'll see a [red screen with an error](debugging.md#in-app-errors-and-warnings). This is OK. The following steps will fix that. +4. Open the in-app [Developer menu](debugging.md#accessing-the-in-app-developer-menu). +5. Go to **Dev Settings** → **Debug server host & port for device**. +6. Type in your machine's IP address and the port of the local dev server (e.g. 10.0.1.1:8081). +7. Go back to the **Developer menu** and select **Reload JS**. You can now enable Live reloading from the [Developer menu](debugging.md#accessing-the-in-app-developer-menu). Your app will reload whenever your JavaScript code has changed. diff --git a/docs/sectionlist.md b/docs/sectionlist.md index 9ccdddcd21e5fc..0716c563d0c786 100644 --- a/docs/sectionlist.md +++ b/docs/sectionlist.md @@ -21,16 +21,19 @@ If you don't need section support and want a simpler interface, use [` Simple Examples: ```javascript -// Example 1 (Homogeneous Rendering) - {item}} - renderSectionHeader={({ section: { title } }) => {title}} - sections={[ - { title: 'Title1', data: ['item1', 'item2'] }, - { title: 'Title2', data: ['item3', 'item4'] }, - { title: 'Title3', data: ['item5', 'item6'] }, - ]} - keyExtractor={(item, index) => item + index} /> +// Example 1 (Homogeneous Rendering) + {item}} + renderSectionHeader={({section: {title}}) => ( + {title} + )} + sections={[ + {title: 'Title1', data: ['item1', 'item2']}, + {title: 'Title2', data: ['item3', 'item4']}, + {title: 'Title3', data: ['item5', 'item6']}, + ]} + keyExtractor={(item, index) => item + index} +/> ``` ```javascript diff --git a/docs/signed-apk-android.md b/docs/signed-apk-android.md index abe7677c9a3220..e8231414b0a72d 100644 --- a/docs/signed-apk-android.md +++ b/docs/signed-apk-android.md @@ -15,16 +15,7 @@ This command prompts you for passwords for the keystore and key, and to provide The keystore contains a single key, valid for 10000 days. The alias is a name that you will use later when signing your app, so remember to take note of the alias. -On Mac if you not sure where is your jdk bin folder is then perform the following command to find it, - `$ /usr/libexec/java_home` -it will output the directroy of jdk which looks like this, - `/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home` -then navigate to that directory by the following command, - `$ cd /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/` -Now you can perform the keytool command with sudo permission as shown below, - `$ sudo keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000` - -_Note: Remember to keep your keystore file private and never commit it to version control._ +On Mac if you not sure where is your jdk bin folder is then perform the following command to find it, `$ /usr/libexec/java_home` it will output the directroy of jdk which looks like this, `/Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home` then navigate to that directory by the following command, `$ cd /Library/Java/JavaVirtualMachines/jdk1.8.0_161.jdk/Contents/Home/` Now you can perform the keytool command with sudo permission as shown below, `$ sudo keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000` _Note: Remember to keep your keystore file private and never commit it to version control._ ### Setting up gradle variables diff --git a/docs/textinput.md b/docs/textinput.md index 4560e425e091b4..ac29cb9e39f9e0 100644 --- a/docs/textinput.md +++ b/docs/textinput.md @@ -697,8 +697,8 @@ Possible values for `textContentType` are: * `username` * `password` -| Type | Required | Platform | -| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | +| Type | Required | Platform | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------- | | enum('none', 'URL', 'addressCity', 'addressCityAndState', 'addressState', 'countryName', 'creditCardNumber', 'emailAddress', 'familyName', 'fullStreetAddress', 'givenName', 'jobTitle', 'location', 'middleName', 'name', 'namePrefix', 'nameSuffix', 'nickname', 'organizationName', 'postalCode', 'streetAddressLine1', 'streetAddressLine2', 'sublocality', 'telephoneNumber', 'username', 'password') | No | iOS | --- diff --git a/docs/tutorial.md b/docs/tutorial.md index d30b4099f9e0ef..18ae50a019d8a0 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -21,7 +21,7 @@ export default class HelloWorldApp extends Component { Hello world! - + ); } } diff --git a/docs/using-a-scrollview.md b/docs/using-a-scrollview.md index 709d3d0d259322..74f72c2db5f037 100644 --- a/docs/using-a-scrollview.md +++ b/docs/using-a-scrollview.md @@ -32,7 +32,7 @@ export default class IScrolledDownAndWhatHappenedNextShockedMe extends Component - + What's the best @@ -44,7 +44,7 @@ export default class IScrolledDownAndWhatHappenedNextShockedMe extends Component - + React Native ); diff --git a/docs/viewpagerandroid.md b/docs/viewpagerandroid.md index 74ec1b25392d77..aa8f8d9a3583df 100644 --- a/docs/viewpagerandroid.md +++ b/docs/viewpagerandroid.md @@ -162,21 +162,21 @@ A helper function to scroll to a specific page in the ViewPager. The transition * position - index of page that will be selected -| Type | Required | -| -------- | -------- | -| Number | Yes | +| Type | Required | +| ------ | -------- | +| Number | Yes | --- ### `setPageWithoutAnimation` -A helper function to scroll to a specific page in the ViewPager. The transition between pages will *not* be animated. +A helper function to scroll to a specific page in the ViewPager. The transition between pages will _not_ be animated. * position - index of page that will be selected -| Type | Required | -| -------- | -------- | -| Number | Yes | +| Type | Required | +| ------ | -------- | +| Number | Yes | ## Type Definitions diff --git a/docs/webview.md b/docs/webview.md index 28ba7934910a88..88bb4bc3a17c96 100644 --- a/docs/webview.md +++ b/docs/webview.md @@ -199,12 +199,10 @@ Function that is invoked when the `WebView` loading starts or ends. ### `originWhitelist` -List of origin strings to allow being navigated to. The strings allow wildcards and get matched against *just* the origin (not the full URL). -If the user taps to navigate to a new page but the new page is not in this whitelist, the URL will be handled by the OS. -The default whitelisted origins are "http://*" and "https://*". +List of origin strings to allow being navigated to. The strings allow wildcards and get matched against _just_ the origin (not the full URL). If the user taps to navigate to a new page but the new page is not in this whitelist, the URL will be handled by the OS. The default whitelisted origins are "http://*" and "https://*". | Type | Required | -| ---------------- | -------- | +| ---------------- | -------- | | array of strings | No | --- @@ -413,8 +411,7 @@ Boolean value that determines whether scrolling is enabled in the `WebView`. The ### `geolocationEnabled` -Set whether Geolocation is enabled in the `WebView`. The default value is `false`. -Used only in Android. +Set whether Geolocation is enabled in the `WebView`. The default value is `false`. Used only in Android. | Type | Required | Platform | | ---- | -------- | -------- | diff --git a/website/blog/2018-05-07-using-typescript-with-react-native.md b/website/blog/2018-05-07-using-typescript-with-react-native.md index c4a478de1d320f..2e607266094050 100644 --- a/website/blog/2018-05-07-using-typescript-with-react-native.md +++ b/website/blog/2018-05-07-using-typescript-with-react-native.md @@ -182,13 +182,15 @@ export class Hello extends React.Component { } this.state = { - enthusiasmLevel: props.enthusiasmLevel || 1 + enthusiasmLevel: props.enthusiasmLevel || 1, }; } - onIncrement = () => this.setState({ enthusiasmLevel: this.state.enthusiasmLevel + 1 }); - onDecrement = () => this.setState({ enthusiasmLevel: this.state.enthusiasmLevel - 1 }); - getExclamationMarks = (numChars: number) => Array(numChars + 1).join("!") + onIncrement = () => + this.setState({enthusiasmLevel: this.state.enthusiasmLevel + 1}); + onDecrement = () => + this.setState({enthusiasmLevel: this.state.enthusiasmLevel - 1}); + getExclamationMarks = (numChars: number) => Array(numChars + 1).join('!'); render() { return ( diff --git a/website/versioned_docs/version-0.54/keyboardavoidingview.md b/website/versioned_docs/version-0.54/keyboardavoidingview.md index 1a4bcc4c7d13b6..53829bb16be11d 100644 --- a/website/versioned_docs/version-0.54/keyboardavoidingview.md +++ b/website/versioned_docs/version-0.54/keyboardavoidingview.md @@ -75,9 +75,9 @@ The style of the content container(View) when behavior is 'position'. Enabled or disabled KeyboardAvoidingView. -| Type | Required | -| ---------- | -------- | -| boolean | Yes | +| Type | Required | +| ------- | -------- | +| boolean | Yes | ## Methods diff --git a/website/versioned_docs/version-0.55/keyboardavoidingview.md b/website/versioned_docs/version-0.55/keyboardavoidingview.md index 1faa56d0054cd5..182faf2b1792b2 100644 --- a/website/versioned_docs/version-0.55/keyboardavoidingview.md +++ b/website/versioned_docs/version-0.55/keyboardavoidingview.md @@ -75,9 +75,9 @@ The style of the content container(View) when behavior is 'position'. Enabled or disabled KeyboardAvoidingView. -| Type | Required | -| ---------- | -------- | -| boolean | Yes | +| Type | Required | +| ------- | -------- | +| boolean | Yes | ## Methods diff --git a/website/versioned_docs/version-0.55/sectionlist.md b/website/versioned_docs/version-0.55/sectionlist.md index e7da558ce1b047..30af827baf014a 100644 --- a/website/versioned_docs/version-0.55/sectionlist.md +++ b/website/versioned_docs/version-0.55/sectionlist.md @@ -19,19 +19,22 @@ A performant interface for rendering sectioned lists, supporting the most handy If you don't need section support and want a simpler interface, use [``](flatlist.md). -Simple Examples: +Simple Examples: ```javascript -// Example 1 (Homogeneous Rendering) - {item}} - renderSectionHeader={({ section: { title } }) => {title}} - sections={[ - { title: 'Title1', data: ['item1', 'item2'] }, - { title: 'Title2', data: ['item3', 'item4'] }, - { title: 'Title3', data: ['item5', 'item6'] }, - ]} - keyExtractor={(item, index) => item + index} /> +// Example 1 (Homogeneous Rendering) + {item}} + renderSectionHeader={({section: {title}}) => ( + {title} + )} + sections={[ + {title: 'Title1', data: ['item1', 'item2']}, + {title: 'Title2', data: ['item3', 'item4']}, + {title: 'Title3', data: ['item5', 'item6']}, + ]} + keyExtractor={(item, index) => item + index} +/> ``` ```javascript