Add docs on platform-specific components

This commit is contained in:
vaukalak
2017-05-22 17:28:15 +03:00
committed by Nicolas Gallagher
parent 3cc1e480a7
commit 118b64a932
+20
View File
@@ -117,6 +117,26 @@ if (Platform.OS === 'web') {
}
```
More significant platform differences should use platform-specific files (see
the webpack configuration above for resolving `*.web.js` files):
For example, with the following files in your project:
```
MyComponent.android.js
MyComponent.ios.js
MyComponent.web.js
```
And the following import:
```js
import MyComponent from './MyComponent';
```
React Native will automatically import the correct variant for each specific
target platform.
## Client-side rendering
Rendering using `ReactNative`: