From 91426c37090afb41ee18581a9e768868bb8c41be Mon Sep 17 00:00:00 2001 From: Drew Smith Date: Thu, 14 Sep 2017 12:34:21 +0100 Subject: [PATCH] Revert faulty change to HelloWorld demo in docs Related to commit/diff: https://github.com/facebook/react-native/commit/6e99e314b232c315628c31f97a865c17c071ad23#diff-692279cda23c48738b9688454811448a Above change breaks "HelloWorld" demo in docs. This pull request reverts things just enough to get the demo working correctly again. I'm new to react-native so I'm not sure if there is another (read: better) solution but by accepting this pull request it would prevent noobs like myself from falling at the first hurdle! --- docs/Tutorial.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/Tutorial.md b/docs/Tutorial.md index c80b6b40643bd2..4e4382ce1e9b2b 100644 --- a/docs/Tutorial.md +++ b/docs/Tutorial.md @@ -19,7 +19,7 @@ In accordance with the ancient traditions of our people, we must first build an ```ReactNativeWebPlayer import React, { Component } from 'react'; -import { Text } from 'react-native'; +import { AppRegistry, Text } from 'react-native'; export default class HelloWorldApp extends Component { render() { @@ -28,6 +28,9 @@ export default class HelloWorldApp extends Component { ); } } + +// skip this line if using Create React Native App +AppRegistry.registerComponent('AwesomeProject', () => HelloWorldApp); ``` If you are feeling curious, you can play around with sample code directly in the web simulators. You can also paste it into your `App.js` file to create a real app on your local machine.