Skip to content

Commit aad7933

Browse files
committed
Props are optional now
1 parent 849bacf commit aad7933

File tree

3 files changed

+27
-31
lines changed

3 files changed

+27
-31
lines changed

lib/BouncyCheckbox.style.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ export const _iconContainer = (
2929
export const _textStyle = (
3030
checked: boolean,
3131
color: string,
32-
fontFamily: string,
33-
fontSize: number,
34-
textDecoration: string,
32+
fontFamily?: string,
33+
fontSize?: number,
34+
textDecoration?: string,
3535
): TextStyle => {
3636
return {
3737
fontSize,

lib/BouncyCheckbox.tsx

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,28 @@ import styles, {
1414
} from "./BouncyCheckbox.style";
1515

1616
export interface IBouncyCheckboxProps {
17-
size: number;
18-
text: string;
19-
color: string;
20-
iconStyle: any;
21-
textStyle: any;
22-
iconName: string;
23-
iconSize: number;
24-
iconType: string;
25-
fillColor: string;
26-
fontSize: number;
27-
iconColor: string;
28-
fontFamily: string;
29-
iconComponent: any;
30-
isChecked: boolean;
31-
unfillColor: string;
32-
borderColor: string;
33-
borderWidth: number;
34-
disableText: boolean;
35-
borderRadius: number;
36-
ImageComponent: any;
37-
checkImageSource: any;
38-
textDecoration: string;
39-
checkImageWidth: number;
40-
checkImageHeight: number;
41-
useNativeDriver: boolean;
42-
onPress: (isChecked: boolean) => void;
17+
size?: number;
18+
text?: string;
19+
color?: string;
20+
iconStyle?: any;
21+
textStyle?: any;
22+
fillColor?: string;
23+
fontSize?: number;
24+
fontFamily?: string;
25+
iconComponent?: any;
26+
isChecked?: boolean;
27+
unfillColor?: string;
28+
borderColor?: string;
29+
borderWidth?: number;
30+
disableText?: boolean;
31+
borderRadius?: number;
32+
ImageComponent?: any;
33+
checkImageSource?: any;
34+
textDecoration?: string;
35+
checkImageWidth?: number;
36+
checkImageHeight?: number;
37+
useNativeDriver?: boolean;
38+
onPress?: (isChecked: boolean) => void;
4339
}
4440

4541
interface IState {
@@ -59,7 +55,7 @@ class BouncyCheckbox extends React.Component<IBouncyCheckboxProps, IState> {
5955
}
6056

6157
componentDidMount() {
62-
this.setState({ checked: this.props.isChecked });
58+
this.setState({ checked: this.props.isChecked || false });
6359
}
6460

6561
spring = () => {

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.1",
3+
"version": "1.0.2",
44
"description": "Fully customizable animated bouncy checkbox for React Native",
55
"keywords": [
66
"bouncy",

0 commit comments

Comments
 (0)