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:
parent
45b8719ca1
commit
ee742277af
|
@ -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);
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue