From 45b8719ca12b7250107d37e6bda206f57e1ec1c3 Mon Sep 17 00:00:00 2001 From: Joel Marcey Date: Thu, 23 Jun 2016 12:24:16 -0700 Subject: [PATCH] ES6-ify View Basics Summary: Closes https://github.com/facebook/react-native/pull/8366 Differential Revision: D3477409 Pulled By: caabernathy fbshipit-source-id: 5906e8dffc7884a6ed527fada5f907702a72c08f --- docs/Basics-Component-View.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/docs/Basics-Component-View.md b/docs/Basics-Component-View.md index 5db73ac25..0a6a728f9 100644 --- a/docs/Basics-Component-View.md +++ b/docs/Basics-Component-View.md @@ -16,17 +16,19 @@ It is recommended that you wrap your components in a `View` to style and control The example below creates a `View` that aligns the `string` `Hello` in the top center of the device, something which could not be done with a `Text` component alone (i.e., a `Text` component without a `View` would place the `string` in a fixed location in the upper corner): ```ReactNativeWebPlayer -import React from 'react'; +import React, { Component } from 'react'; import { AppRegistry, Text, View } from 'react-native'; -const AwesomeProject = () => { - return ( - - Hello! - - ); +class ViewBasics extends Component { + render() { + return ( + + Hello! + + ); + } } // App registration and rendering -AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject); +AppRegistry.registerComponent('AwesomeProject', () => ViewBasics); ```