-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.js
39 lines (36 loc) · 904 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
import { StyleSheet, View, Text } from "react-native";
import React, { useState } from "react";
import CheckBox from "./CheckBox";
export default function App() {
const [music, setMusic] = useState(false);
const [dancing, setDancing] = useState(false);
const [reading, setReading] = useState(false);
return (
<View style={styles.container}>
<Text style={{fontSize:20}}>CHECKBOX {'\n'} using CUSTOM Component{'\n'}</Text>
<CheckBox
onPress={() => setMusic(!music)}
title="Music"
isChecked={music}
/>
<CheckBox
onPress={() => setDancing(!dancing)}
title="Dancing"
isChecked={dancing}
/>
<CheckBox
onPress={() => setReading(!reading)}
title="Reading"
isChecked={reading}
/>
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#A1E3D8",
justifyContent: "center",
alignItems: "center",
},
});