-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo1.js
64 lines (43 loc) · 1.07 KB
/
demo1.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import React from 'react';
import {
SafeAreaView,
View,
Text,
Image,
StatusBar,
} from 'react-native';
class App extends React.Component {
constructor(props) {
super(props);
this.state ={
//data:require("./data.json")
}
}
_renderitem() {
const jsxarr=[];
const data = require("./data.json");
for (let i = 0; i < data.length; i++) {
const element = data[i];
jsxarr.push(
<View style={{height:100,marginLeft:5,marginTop:5}}>
<Image source={require('./assets/small.jpg')}/>
<Text>{element.name}</Text>
</View>
)
}
return jsxarr;
}
render() {
return (
<>
<StatusBar />
<SafeAreaView>
<View style= {{flex:1,flexDirection:"row",flexWrap:"wrap"}}>
{this._renderitem()}
</View>
</SafeAreaView>
</>
);
}
}
export default App;