diff --git a/README.md b/README.md index efb538f1..39202413 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ styles defined in JavaScript into "Atomic CSS". To install in your app: ``` -npm install --save react@0.14 react-dom@0.14 react-native-web +npm install --save react@0.15 react-native-web ``` Read the [Client and Server rendering](docs/guides/rendering.md) guide. diff --git a/docs/guides/rendering.md b/docs/guides/rendering.md index ae762421..4a5545c5 100644 --- a/docs/guides/rendering.md +++ b/docs/guides/rendering.md @@ -21,15 +21,14 @@ module.exports = { Rendering without using the `AppRegistry`: ```js -import ReactDOM from 'react-dom' -import ReactDOMServer from 'react-dom/server' +import ReactNative from 'react-native' // DOM render -ReactDOM.render(
, document.getElementById('react-app')) +ReactNative.render(, document.getElementById('react-app')) // Server render -ReactDOMServer.renderToString() -ReactDOMServer.renderToStaticMarkup() +ReactNative.renderToString() +ReactNative.renderToStaticMarkup() ``` Rendering using the `AppRegistry`: @@ -54,7 +53,10 @@ import { AppRegistry } from 'react-native' AppRegistry.registerComponent('App', () => App) // mounts and runs the app within the `rootTag` DOM node -AppRegistry.runApplication('App', { initialProps, rootTag: document.getElementById('react-app') }) +AppRegistry.runApplication('App', { + initialProps: {}, + rootTag: document.getElementById('react-app') +}) ``` React Native for Web extends `AppRegistry` to provide support for server-side @@ -85,7 +87,7 @@ export default AppShell import App from './App' import AppShell from './AppShell' -import { AppRegistry } from 'react-native' +import ReactNative, { AppRegistry } from 'react-native' // registers the app AppRegistry.registerComponent('App', () => App) @@ -94,5 +96,5 @@ AppRegistry.registerComponent('App', () => App) const { html, style, styleElement } = AppRegistry.prerenderApplication('App', { initialProps }) // renders the full-page markup -const renderedApplicationHTML = React.renderToStaticMarkup(