Skip to content

Commit 774a624

Browse files
committed
jsx to function
1 parent a6ff334 commit 774a624

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ npm i react-native-bouncy-checkbox
4444
- `iconStyle`
4545
- `bounceEffect`
4646
- `bounceFriction`
47-
- `TextComponent`
47+
- `textComponent`
4848

4949
## Import
5050

@@ -79,7 +79,7 @@ import BouncyCheckbox from "react-native-bouncy-checkbox";
7979
| Property | Type | Default | Description |
8080
| -------------------- | :-------: | :--------------: | ------------------------------------------------------------------------------------------------------------------------------------------ |
8181
| text | string | undefined | set the checkbox's text |
82-
| TextComponent | component | undefined | set the checkbox's text by a React Component |
82+
| textComponent | component | undefined | set the checkbox's text by a React Component |
8383
| onPress | function | null | set your own onPress functionality after the bounce effect, callback receives the next `isChecked` boolean if disableBuiltInState is false |
8484
| disableText | boolean | false | if you want to use checkbox without text, you can enable it |
8585
| size | number | 25 | size of `width` and `height` of the checkbox |

lib/BouncyCheckbox.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface IBouncyCheckboxProps {
1818
style?: StyleProp<ViewStyle>;
1919
size?: number;
2020
text?: string;
21-
TextComponent?: React.ElementType;
21+
textComponent?: React.ElementType;
2222
iconStyle?: any;
2323
textStyle?: StyleProp<TextStyle>;
2424
fillColor?: string;
@@ -125,7 +125,7 @@ class BouncyCheckbox extends React.Component<IBouncyCheckboxProps, IState> {
125125
renderCheckboxText = () => {
126126
const {
127127
text,
128-
TextComponent,
128+
textComponent,
129129
isChecked,
130130
textStyle,
131131
textContainerStyle,
@@ -134,8 +134,8 @@ class BouncyCheckbox extends React.Component<IBouncyCheckboxProps, IState> {
134134
} = this.props;
135135
const { checked } = this.state;
136136
return (
137-
!disableText &&
138-
(TextComponent ? <TextComponent/> : (
137+
!disableText &&
138+
(textComponent || (
139139
<View style={[styles.textContainer, textContainerStyle]}>
140140
<Text
141141
style={[

0 commit comments

Comments
 (0)