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

Button.d.ts seems incorrect. Error: "Types of property 'ref' are incompatible." #10405

cdeutsch opened this Issue May 7, 2018 · 4 comments


None yet
3 participants

cdeutsch commented May 7, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.




OSX, Chrome

Reproduction link
See reproduction below as well.

Steps to reproduce

See the code and error in MyButton.tsx in reproduction.

What is expected?

You should be able to spread all ButtonProps to a Button component.

What is actually happening?

ButtonProps contains incorrect properties.

The bug was introduced in #10229 /cc @whtsky


This comment has been minimized.


yesmeck commented May 8, 2018

@yesmeck yesmeck closed this May 8, 2018


This comment has been minimized.


cdeutsch commented May 8, 2018

@yesmeck I have the latest @types/react

I think we may just need to omit ref from the BaseButtonProps<T> definition:
Omit<Omit<React.HTMLProps<T>, 'size'>, 'ref'>

/cc @whtsky

Here's a better reproduction:


There are issues just trying to set a ref:


cdeutsch added a commit to cdeutsch/ant-design that referenced this issue May 8, 2018

@yesmeck yesmeck reopened this May 9, 2018


This comment has been minimized.

frantic1048 commented May 9, 2018

Why not use React.createRef<Button>() instead but React.createRef<HTMLAnchorElement>() ? The ref is used on a Button, not HTMLAnchorElement. (notice the last line of the type hint: "Property 'timeout' is missing in type 'HTMLAnchorElement'") @cdeutsch


This comment has been minimized.


cdeutsch commented May 9, 2018

@frantic1048 I've tried all combinations. They all throw the error.

cdeutsch added a commit to cdeutsch/ant-design that referenced this issue May 9, 2018

yesmeck added a commit that referenced this issue May 10, 2018

bors bot added a commit to mozilla/delivery-console that referenced this issue May 14, 2018

Merge #160
160: Update dependency antd to v3.5.2 r=rehandalal a=renovate[bot]

This Pull Request updates dependency [antd]( from `v3.5.1` to `v3.5.2`

<summary>Release Notes</summary>

### [`v3.5.2`](
[Compare Source](ant-design/ant-design@3.5.1...3.5.2)
- 🐞 Fixed `Cascader` displayRender z-index issue. [#&#8203;10433](`ant-design/ant-design#10433)
- 🐞 Fixed `Button` Types of property 'ref' are incompatible. [#&#8203;10405](`ant-design/ant-design#10405)
- 🐞 Fixed `Table` filter doesn't work on checkbox click. [#&#8203;10452](`ant-design/ant-design#10452)
- 🐞 Fixed the height of `Form` item when checks position is dithered. [#&#8203;10445](`ant-design/ant-design#10445)
- 🌟 Allow to use any CSS units for `Layout` width. [#&#8203;10479](`ant-design/ant-design#10479)


- 🐞 修复 `Cascader` 的 displayRender 问题。[#&#8203;10433](`ant-design/ant-design#10433)
- 🐞 修复 `Button` ref 不兼容问题。[#&#8203;10405](`ant-design/ant-design#10405)
- 🐞 修复 `Table` 过滤器在复选框上不起作用。[#&#8203;10452](`ant-design/ant-design#10452)
- 🐞 修复 `Form` 表单项校验位置高度时出现抖动问题。[#&#8203;10445](`ant-design/ant-design#10445)
- 🌟 设置 `Layout` 宽度时,允许使用任何的 CSS 单位。 [#&#8203;10479](`ant-design/ant-design#10479)




This PR has been generated by [Renovate Bot](

Co-authored-by: Renovate Bot <>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment