File tree 3 files changed +4
-4
lines changed
3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -58,9 +58,9 @@ import CounterInput from "react-native-counter-input";
58
58
59
59
| Property | Type | Default | Description |
60
60
| ----------------------------- | :-------: | :-------: | ----------------------------------------------------------------------------------------- |
61
- | onChange | function | undefined | set your own logic for onChange method, it triggers on any change |
62
61
| horizontal | boolean | false | make the button horizontal design |
63
62
| initial | number | 0 | set the initial value for the counter input |
63
+ | onChange | function | undefined | set your own logic for onChange method, it triggers on any change |
64
64
| onChangeText | function | undefined | it triggers when the TextInput changes |
65
65
| onIncreasePress | function | undefined | it triggers when the increase button is pressed |
66
66
| onDecreasePress | function | undefined | it triggers when the decrease button is pressed |
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ export interface ICounterInputProps {
29
29
onIncreasePress ?: ( counter : number ) => void ;
30
30
onDecreasePress ?: ( counter : number ) => void ;
31
31
onChangeText ?: ( counter : number | string ) => void ;
32
- onChange : ( counter : number | string ) => void ;
32
+ onChange : ( counter : number ) => void ;
33
33
}
34
34
35
35
interface IState {
@@ -67,7 +67,7 @@ export default class CounterInput extends React.Component<
67
67
68
68
handleOnChangeText = ( text : string ) => {
69
69
const { onChange, onChangeText } = this . props ;
70
- let _number : number | string = parseInt ( text ) || "" ;
70
+ let _number : number = parseInt ( text ) || 0 ;
71
71
this . setState ( { counter : _number } , ( ) => {
72
72
onChangeText && onChangeText ( this . state . counter ) ;
73
73
onChange && onChange ( this . state . counter ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-native-counter-input" ,
3
- "version" : " 0.1.5 " ,
3
+ "version" : " 0.1.6 " ,
4
4
"description" : " Counter Input with fully customizable options for React Native" ,
5
5
"main" : " ./build/dist/CounterInput.js" ,
6
6
"repository" :
" [email protected] :WrathChaos/react-native-counter-input.git" ,
You can’t perform that action at this time.
0 commit comments