ES6-ify Image Basics

Summary: Closes https://github.com/facebook/react-native/pull/8365

Differential Revision: D3477411

Pulled By: caabernathy

fbshipit-source-id: 26214fcf13c9e1352e198f34fcd6f5e88f1fe2da
This commit is contained in:
Joel Marcey 2016-06-23 12:24:58 -07:00 committed by Facebook Github Bot 0
parent 45b8719ca1
commit ee742277af
1 changed files with 8 additions and 6 deletions

View File

@ -16,15 +16,17 @@ The simplest way to render an image is to provide a source file to that image vi
This example displays a checkbox `Image` on the device.
```ReactNativeWebPlayer
import React from 'react';
import React, { Component } from 'react';
import { AppRegistry, Image } from 'react-native';
const AwesomeProject = () => {
return (
<Image source={require('./img/favicon.png')} />
);
class ImageBasics extends Component {
render() {
return (
<Image source={require('./img/favicon.png')} />
);
}
}
// App registration and rendering
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
AppRegistry.registerComponent('AwesomeProject', () => ImageBasics);
```