mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-05-10 01:15:00 +08:00
ES6-ify ScrollView basics
Summary: Closes https://github.com/facebook/react-native/pull/8368 Differential Revision: D3477381 Pulled By: caabernathy fbshipit-source-id: 0c43a9b8309db8f268a2776ebff2b4e52df559df
This commit is contained in:
committed by
Facebook Github Bot 0
parent
678ea5b233
commit
efb8af4e46
@@ -18,10 +18,11 @@ The [`ScrollView`](/react-native/docs/scrollview.html) is a generic scrolling co
|
||||
This contrived example creates a horizontal `ScrollView` with a static amount of heterogenous elements (images and text).
|
||||
|
||||
```ReactNativeWebPlayer
|
||||
import React, { AppRegistry, ScrollView, Image, Text, View } from 'react-native'
|
||||
import React, { Component } from 'react';
|
||||
import{ AppRegistry, ScrollView, Image, Text, View } from 'react-native'
|
||||
|
||||
var SimpleScrollView = React.createClass({
|
||||
render(){
|
||||
class ScrollViewBasics extends Component {
|
||||
render() {
|
||||
return(
|
||||
<ScrollView horizontal={true}>
|
||||
<View>
|
||||
@@ -63,8 +64,8 @@ var SimpleScrollView = React.createClass({
|
||||
</ScrollView>
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
AppRegistry.registerComponent('AwesomeProject', () => SimpleScrollView);
|
||||
AppRegistry.registerComponent('AwesomeProject', () => ScrollViewBasics);
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user