Skip to content

Commit 31aa240

Browse files
JoelMarceyMorgan Pretty
authored andcommitted
ES6-ify Image Basics
Summary: Closes facebook#8365 Differential Revision: D3477411 Pulled By: caabernathy fbshipit-source-id: 26214fcf13c9e1352e198f34fcd6f5e88f1fe2da
1 parent 7b86433 commit 31aa240

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/Basics-Component-Image.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ The simplest way to render an image is to provide a source file to that image vi
1616
This example displays a checkbox `Image` on the device.
1717

1818
```ReactNativeWebPlayer
19-
import React from 'react';
19+
import React, { Component } from 'react';
2020
import { AppRegistry, Image } from 'react-native';
2121
22-
const AwesomeProject = () => {
23-
return (
24-
<Image source={require('./img/favicon.png')} />
25-
);
22+
class ImageBasics extends Component {
23+
render() {
24+
return (
25+
<Image source={require('./img/favicon.png')} />
26+
);
27+
}
2628
}
2729
2830
// App registration and rendering
29-
AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
31+
AppRegistry.registerComponent('AwesomeProject', () => ImageBasics);
3032
```

0 commit comments

Comments
 (0)