1- import React from "react" ;
2- import { SafeAreaView , StyleSheet , Text , View } from "react-native" ;
3- import BouncyCheckbox from "react-native-bouncy-checkbox" ;
4- import RNBounceable from "@freakycoder/react-native-bounceable" ;
1+ import React from 'react' ;
2+ import { SafeAreaView , StyleSheet , Text , View } from 'react-native' ;
3+ // import BouncyCheckbox from 'react-native-bouncy-checkbox';
4+ import BouncyCheckbox from './build/dist/BouncyCheckbox' ;
5+ import RNBounceable from '@freakycoder/react-native-bounceable' ;
56
67const App = ( ) => {
78 let bouncyCheckboxRef : BouncyCheckbox | null = null ;
@@ -11,26 +12,25 @@ const App = () => {
1112 < SafeAreaView
1213 style = { {
1314 flex : 1 ,
14- alignItems : "center" ,
15- justifyContent : "center" ,
16- } }
17- >
15+ alignItems : 'center' ,
16+ justifyContent : 'center' ,
17+ } } >
1818 < View
1919 style = { {
2020 height : 30 ,
2121 width : 150 ,
22- alignItems : " center" ,
23- justifyContent : " center" ,
22+ alignItems : ' center' ,
23+ justifyContent : ' center' ,
2424 borderRadius : 12 ,
25- backgroundColor : checkboxState ? "#34eb83" : "#eb4034" ,
26- } }
27- >
25+ backgroundColor : checkboxState ? '#34eb83' : '#eb4034' ,
26+ } } >
2827 < Text
29- style = { { color : "#fff" } }
30- > { `Check Status: ${ checkboxState . toString ( ) } ` } </ Text >
28+ style = { {
29+ color : '#fff' ,
30+ } } > { `Check Status: ${ checkboxState . toString ( ) } ` } </ Text >
3131 </ View >
3232 < BouncyCheckbox
33- style = { { marginTop : 16 } }
33+ style = { { marginTop : 16 } }
3434 ref = { ( ref : any ) => ( bouncyCheckboxRef = ref ) }
3535 isChecked = { checkboxState }
3636 text = "Synthetic Checkbox"
@@ -43,15 +43,18 @@ const App = () => {
4343 style = { {
4444 marginTop : 16 ,
4545 height : 50 ,
46- width : " 90%" ,
47- backgroundColor : " #ffc484" ,
46+ width : ' 90%' ,
47+ backgroundColor : ' #ffc484' ,
4848 borderRadius : 12 ,
49- alignItems : " center" ,
50- justifyContent : " center" ,
49+ alignItems : ' center' ,
50+ justifyContent : ' center' ,
5151 } }
52- onPress = { ( ) => bouncyCheckboxRef ?. onPress ( ) }
53- >
54- < Text style = { { color : "#fff" } } > Synthetic Checkbox Press</ Text >
52+ onPress = { ( ) => {
53+ console . log ( bouncyCheckboxRef ?. onPress ( ) ) ;
54+ // bouncyCheckboxRef?.current.onPress();
55+ // bouncyCheckboxRef?.onPress();
56+ } } >
57+ < Text style = { { color : '#fff' } } > Synthetic Checkbox Press</ Text >
5558 </ RNBounceable >
5659 </ SafeAreaView >
5760 ) ;
0 commit comments