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

TS definition: missing 'value' on RadioComponentProps / CheckboxComponentProps #21

Open
codelizrd opened this issue Jun 17, 2019 · 1 comment

Comments

@codelizrd
Copy link

Typescript complains when setting a value on a Radio element:

<Radio name='option' label='Option 1' value='option1' />
<Radio name='option' label='Option 2' value='option2' />

Type '{ name: string; label: string | object | (string | object)[] | undefined; value:'option1'; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<{ children?: ReactNode; }>'.
Property 'value' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly & Readonly<{ children?: ReactNode; }>'. TS2322

Then manually adding an 'value: string' option to the definition it works (like plain JS).

@rolandvar
Copy link

How did you fix the problem?

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

No branches or pull requests

2 participants