-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButtonComponent.js
More file actions
56 lines (54 loc) · 859 Bytes
/
ButtonComponent.js
File metadata and controls
56 lines (54 loc) · 859 Bytes
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
import React, { Component } from 'react';
import {
Platform,
StyleSheet,
View
} from 'react-native';
import { Button,Caption } from 'react-native-paper';
const data =[{
"name": "abc",
"age": 31,
"city": "New York",
"type": "text",
"id":1
},
{
"name": "Akshay",
"age": 25,
"city": "Pune",
"type": "button",
"id":2
},
{
"name": "Shubham",
"age": 30,
"city": "Mumbai",
"type": "textinput",
"id":3
},
{
"name": "kjbakgb",
"age": 30,
"city": "jabekgb",
"type": "currency",
"id":4
}];
export default class ButtonComponent extends Component {
render() {
return (
<View>
{data.map(function(row){
if(row.type == "button")
return(
<View>
<Button flat onPress={() => console.log('Pressed')}>
Press me
</Button>
<Caption>Caption</Caption>
</View>
)
})}
</View>
);
}
}