-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.js
41 lines (35 loc) · 844 Bytes
/
App.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import React from 'react'
import { ListView, StyleSheet, Text, View } from 'react-native'
import Header from './Header'
export default class App extends React.Component {
constructor() {
super()
const ds = new ListView.DataSource(
{ rowHasChanged: (r1, r2) => r1 !== r2 })
this.state = {
dataSource: ds.cloneWithRows(['row 1', 'row 2']),
}
}
render() {
return (
<ListView
style={styles.list}
dataSource={this.state.dataSource}
renderHeader={Header}
renderRow={(rowData) => <Text>{rowData}</Text>}
/>
)
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
list: {
borderBottomColor: 'black',
borderWidth: 1,
}
})