Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input 配合 React 16 时产生类型错误 (Property 'enterKeyHint' is missing) #6636

Open
viko16 opened this issue Jun 3, 2024 · 2 comments
Labels

Comments

@viko16
Copy link

viko16 commented Jun 3, 2024

Version of antd-mobile

5.36.1

Operating system and its version

No response

Browser and its version

No response

Sandbox to reproduce

https://codesandbox.io/p/sandbox/solitary-pine-2dv4ys?file=%2Fsrc%2FApp.tsx

What happened?

What happened

enterKeyHint 是 React 17 才开始引入的,之前为了兼容 React 16 才把定义写在内部

疑似近期的 PR #6598 改为从 NativeInputProps 获取,影响对 @types/react 16 的兼容性

复现版本: npm i [email protected] @types/[email protected] @types/[email protected]

image

Expect

建议恢复原有类型写法,大版本下保持对 React 16.8+ 的兼容

Relevant log output

Property 'enterKeyHint' is missing in type '{ placeholder: string; clearable: true; }' but required in type 'Pick<NativeInputProps, "pattern" | "id" | "onClick" | "disabled" | "onCompositionEnd" | "onCompositionStart" | "onFocus" | "onBlur" | "onKeyDown" | "onKeyUp" | ... 12 more ... | "minLength">'.typescript(2741)
@viko16 viko16 added the bug label Jun 3, 2024
@yolilufei
Copy link

都一个月了还没人接手么?我看最新版本还没有修复,目前只能用固定版本临时解决

@afc163
Copy link
Member

afc163 commented Jul 5, 2024

@yolilufei 欢迎来 PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants