Skip to content

Commit

Permalink
Fix type annotation. #740
Browse files Browse the repository at this point in the history
  • Loading branch information
s-yadav committed May 14, 2023
1 parent 2bb335c commit 38235e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ type NumberFormatBase = {
displayType?: 'input' | 'text';
inputMode?: InputAttributes['inputMode'];
renderText?: (formattedValue: string, otherProps: Partial<NumberFormatBase>) => React.ReactNode;
format: FormatInputValueFunction;
removeFormatting: RemoveFormattingFunction;
format?: FormatInputValueFunction;
removeFormatting?: RemoveFormattingFunction;
getInputRef?: ((el: HTMLInputElement) => void) | React.Ref<any>;
value?: number | string | null;
defaultValue?: number | string | null;
Expand All @@ -75,7 +75,7 @@ type NumberFormatBase = {
onChange?: InputAttributes['onChange'];
onFocus?: InputAttributes['onFocus'];
onBlur?: InputAttributes['onBlur'];
getCaretBoundary: (formattedValue: string) => boolean[];
getCaretBoundary?: (formattedValue: string) => boolean[];
isValidInputCharacter?: (character: string) => boolean;
};

Expand Down
1 change: 1 addition & 0 deletions test/types/number_format.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ function NumberFormatBaseTest() {
size="small"
style={{ color: '#222' }}
/>
<NumberFormatBase defaultValue="123" format={(value) => value} />
</>
);
}
Expand Down

0 comments on commit 38235e0

Please sign in to comment.