Skip to content

Commit 70390ff

Browse files
committed
TouchableOpacity prop drilling is here
1 parent cf07b7b commit 70390ff

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

example/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react";
22
import { View, Image, StatusBar, SafeAreaView } from "react-native";
33
import AppleHeader from "react-native-apple-header";
44
import BottomSearchBar from "react-native-bottom-search-bar";
5-
import BouncyCheckbox from "react-native-bouncy-checkbox";
5+
import BouncyCheckbox from "./build/dist/BouncyCheckbox";
66

77
const App = () => {
88
return (
@@ -19,13 +19,14 @@ const App = () => {
1919
unfillColor="#FFFFFF"
2020
// iconComponent={<IconDog color={"red"} width={12} strokeWidth={3} />}
2121
textColor="#333"
22-
size={10}
22+
size={25}
2323
disableTextDecoration={true}
2424
fontSize={16}
2525
text="asdasd"
2626
/>
2727
<BouncyCheckbox
2828
isChecked={false}
29+
disabled
2930
textColor="#000"
3031
unfillColor="white"
3132
borderRadius={10}

lib/BouncyCheckbox.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
import * as React from "react";
22
import {
3-
Animated,
4-
Easing,
53
Text,
6-
TouchableOpacity,
74
View,
85
Image,
6+
Easing,
7+
Animated,
8+
TouchableOpacity,
9+
TouchableOpacityProps,
910
} from "react-native";
1011
import styles, {
1112
_textStyle,
1213
_iconContainer,
1314
_iconImageStyle,
1415
} from "./BouncyCheckbox.style";
1516

16-
export interface IBouncyCheckboxProps {
17+
export interface ISource {
18+
source: string | { uri: string };
19+
}
20+
21+
export interface IBouncyCheckboxProps extends TouchableOpacityProps {
1722
style?: any;
1823
size?: number;
1924
text?: string;
@@ -31,11 +36,11 @@ export interface IBouncyCheckboxProps {
3136
disableText?: boolean;
3237
borderRadius?: number;
3338
ImageComponent?: any;
34-
checkImageSource?: any;
3539
textDecoration?: string;
3640
checkImageWidth?: number;
3741
checkImageHeight?: number;
3842
useNativeDriver?: boolean;
43+
checkImageSource?: ISource;
3944
onPress?: (isChecked: boolean) => void;
4045
}
4146

@@ -132,6 +137,7 @@ class BouncyCheckbox extends React.Component<IBouncyCheckboxProps, IState> {
132137
} = this.props;
133138
return (
134139
<TouchableOpacity
140+
{...this.props}
135141
style={[styles.container, style]}
136142
onPress={this.spring.bind(this, Easing.bounce)}
137143
>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-native-bouncy-checkbox",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"description": "Fully customizable animated bouncy checkbox for React Native",
55
"keywords": [
66
"bouncy",

0 commit comments

Comments
 (0)