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

Radio.Button typescript - can't find onClick attribute #24692

Closed
1 task done
FBenaziz opened this issue Jun 2, 2020 · 1 comment · Fixed by #24693
Closed
1 task done

Radio.Button typescript - can't find onClick attribute #24692

FBenaziz opened this issue Jun 2, 2020 · 1 comment · Fixed by #24693

Comments

@FBenaziz
Copy link

FBenaziz commented Jun 2, 2020

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

Reproduction link

Edit on CodeSandbox

Steps to reproduce

I can't reproduce it on the sandbox, there is no typescript check.

You just need to add an onClick on the Radio.Button

What is expected?

onClick should be in the props of Radio.Button in the typescript

What is actually happening?

I have a typescript error on the onClick.

/// <reference types="react" />
import Group from './group';
import Button from './radioButton';
import { RadioProps } from './interface';
export * from './interface';
interface CompoundedComponent extends React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLElement>> {
    Group: typeof Group;
    Button: typeof Group;
}
declare const Radio: CompoundedComponent;
export { Button, Group };
export default Radio;

Group and Button have both "typeof Group"
I think Button should be "typeof Button"

Environment Info
antd 4.3.1
React react 16.13.1
System Ubuntu 18.04
Browser Chromium
@FBenaziz FBenaziz changed the title ButtonProps Radio.Button typescript - can't find onClick Jun 2, 2020
@FBenaziz FBenaziz changed the title Radio.Button typescript - can't find onClick Radio.Button typescript - can't find onClick attribute Jun 2, 2020
@FBenaziz
Copy link
Author

FBenaziz commented Jun 2, 2020

Thank you for your work, you are amazing ! :)

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

Successfully merging a pull request may close this issue.

2 participants