Skip to content

Commit 087cf8a

Browse files
JoelMarceyMorgan Pretty
authored andcommitted
ES6-ify ScrollView basics
Summary: Closes facebook#8368 Differential Revision: D3477381 Pulled By: caabernathy fbshipit-source-id: 0c43a9b8309db8f268a2776ebff2b4e52df559df
1 parent 5f3f000 commit 087cf8a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

docs/Basics-Component-ScrollView.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ The [`ScrollView`](/react-native/docs/scrollview.html) is a generic scrolling co
1818
This contrived example creates a horizontal `ScrollView` with a static amount of heterogenous elements (images and text).
1919

2020
```ReactNativeWebPlayer
21-
import React, { AppRegistry, ScrollView, Image, Text, View } from 'react-native'
21+
import React, { Component } from 'react';
22+
import{ AppRegistry, ScrollView, Image, Text, View } from 'react-native'
2223
23-
var SimpleScrollView = React.createClass({
24-
render(){
24+
class ScrollViewBasics extends Component {
25+
render() {
2526
return(
2627
<ScrollView horizontal={true}>
2728
<View>
@@ -63,8 +64,8 @@ var SimpleScrollView = React.createClass({
6364
</ScrollView>
6465
);
6566
}
66-
});
67+
}
6768
6869
69-
AppRegistry.registerComponent('AwesomeProject', () => SimpleScrollView);
70+
AppRegistry.registerComponent('AwesomeProject', () => ScrollViewBasics);
7071
```

0 commit comments

Comments
 (0)