diff --git a/src/Input.tsx b/src/Input.tsx index 075ae05..6a164aa 100644 --- a/src/Input.tsx +++ b/src/Input.tsx @@ -110,23 +110,28 @@ const Input = forwardRef((props, ref) => { const getInputElement = () => { // Fix https://fb.me/react-unknown-prop - const otherProps = omit(props as InputProps, [ - 'prefixCls', - 'onPressEnter', - 'addonBefore', - 'addonAfter', - 'prefix', - 'suffix', - 'allowClear', - // Input elements must be either controlled or uncontrolled, - // specify either the value prop, or the defaultValue prop, but not both. - 'defaultValue', - 'showCount', - 'classes', - 'htmlSize', - 'styles', - 'classNames', - ]); + const otherProps = omit( + props as Omit & { + value?: React.InputHTMLAttributes['value']; + }, + [ + 'prefixCls', + 'onPressEnter', + 'addonBefore', + 'addonAfter', + 'prefix', + 'suffix', + 'allowClear', + // Input elements must be either controlled or uncontrolled, + // specify either the value prop, or the defaultValue prop, but not both. + 'defaultValue', + 'showCount', + 'classes', + 'htmlSize', + 'styles', + 'classNames', + ], + ); return ( ; +export type ValueType = InputHTMLAttributes['value'] | bigint; + export interface BaseInputProps extends CommonInputProps { - value?: InputHTMLAttributes['value']; + value?: ValueType; inputElement: ReactElement; prefixCls?: string; className?: string; @@ -68,7 +70,11 @@ export interface ShowCountProps { export interface InputProps extends CommonInputProps, - Omit, 'size' | 'prefix' | 'type'> { + Omit< + InputHTMLAttributes, + 'size' | 'prefix' | 'type' | 'value' + > { + value?: ValueType; prefixCls?: string; // ref: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#%3Cinput%3E_types type?: LiteralUnion< diff --git a/tests/index.test.tsx b/tests/index.test.tsx index 33d4322..060c608 100644 --- a/tests/index.test.tsx +++ b/tests/index.test.tsx @@ -75,6 +75,10 @@ describe('Input', () => { await user.click(container.querySelector('.rc-input-clear-icon')!); expect(document.activeElement).toBe(container.querySelector('input')); }); + + it('support bigint type', () => { + expect().toBeTruthy(); + }); }); describe('should support showCount', () => {