mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-06-07 20:21:25 +00:00
Update docs
This commit is contained in:
@@ -142,6 +142,7 @@ AppRegistry.runApplication('MyApp', { rootTag: document.getElementById('react-ro
|
|||||||
* [react-native-web-player](https://github.com/dabbott/react-native-web-player)
|
* [react-native-web-player](https://github.com/dabbott/react-native-web-player)
|
||||||
* [react-web](https://github.com/taobaofed/react-web)
|
* [react-web](https://github.com/taobaofed/react-web)
|
||||||
* [react-native-for-web](https://github.com/KodersLab/react-native-for-web)
|
* [react-native-for-web](https://github.com/KodersLab/react-native-for-web)
|
||||||
|
* [rhinos-app](https://github.com/rhinos-app/rhinos-app-dev)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|||||||
@@ -62,16 +62,13 @@ AppRegistry.runApplication('App', {
|
|||||||
initialProps: {},
|
initialProps: {},
|
||||||
rootTag: document.getElementById('react-app')
|
rootTag: document.getElementById('react-app')
|
||||||
})
|
})
|
||||||
|
|
||||||
// prerender the app
|
|
||||||
const { html, styleElement } = AppRegistry.prerenderApplication('App', { initialProps })
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Server-side rendering
|
## Server-side rendering
|
||||||
|
|
||||||
Rendering using the `AppRegistry`:
|
Rendering using the `AppRegistry`:
|
||||||
|
|
||||||
```
|
```js
|
||||||
import ReactDOMServer from 'react-dom/server'
|
import ReactDOMServer from 'react-dom/server'
|
||||||
import ReactNative, { AppRegistry } from 'react-native'
|
import ReactNative, { AppRegistry } from 'react-native'
|
||||||
|
|
||||||
@@ -84,4 +81,4 @@ AppRegistry.registerComponent('App', () => AppContainer)
|
|||||||
// prerender the app
|
// prerender the app
|
||||||
const { element, stylesheet } = AppRegistry.getApplication('App', { initialProps });
|
const { element, stylesheet } = AppRegistry.getApplication('App', { initialProps });
|
||||||
const initialHTML = ReactDOMServer.renderToString(element);
|
const initialHTML = ReactDOMServer.renderToString(element);
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user