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

Typing issues with Typescript 3 and new LibraryManagedAttributes feature #11697

Closed
1 task done
cdeutsch opened this issue Aug 9, 2018 · 15 comments
Closed
1 task done
Assignees

Comments

@cdeutsch
Copy link
Contributor

cdeutsch commented Aug 9, 2018

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

Possibly related to #11677

Version

3.8.0

Environment

typescript@3.0.1 @types/react@16.4.8 @types/react-dom@16.0.7

Reproduction link

https://github.com/cdeutsch/LibraryManagedAttributes-Repro/

Steps to reproduce

Try to use <Input> with TypeScript 3 and latest @types/react and @types/react-dom

What is expected?

No errors

What is actually happening?

Type '{}' is not assignable to type 'Pick<MergePropTypes<Readonly<{ children?: ReactNode; }> & Readonly, InferProps<{ type: any; id: any; size: any; maxLength: any; disabled: any; value: any; defaultValue: any; className: any; addonBefore: any; ... 9 more ...; suffix: any; }>>, "children" | ... 281 more ... | "autosize">'.
Property 'autosize' is missing in type '{}'.


More information here:
DefinitelyTyped/DefinitelyTyped#27805

@huangbinjie
Copy link

I have the same issue.

3 similar comments
@fengweilin
Copy link

I have the same issue.

@graykick
Copy link

I have the same issue.

@ghost
Copy link

ghost commented Aug 12, 2018

I have the same issue.

@IssueHuntBot
Copy link

@BoostIO funded this issue with $30. Visit this issue on Issuehunt

@IssueHuntBot
Copy link

@yesmeck has started working. Visit this issue on Issuehunt

@elie222
Copy link

elie222 commented Aug 16, 2018

Same issue. When will the fix get pushed to npm?

@cdeutsch
Copy link
Contributor Author

@elie222 it should already be fixed.

Requires upgrading Ant and @types/react and @types/react-dom

@eloff
Copy link

eloff commented Sep 8, 2018

With tsc 3.0.1 I was getting:

Property 'autosize' is missing in type for Input
Property 'combobox' is missing in type for Select
Property 'htmlType' is missing in type for Button

When I upgraded to antd (3.9.1), @types/react (16.4.13), and @types/react-dom (16.0.7) the problem went away.

@Spenhouet
Copy link

@elie222 it should already be fixed.

Requires upgrading Ant and @types/react and @types/react-dom

I don't use Ant at all, upgraded to "@types/react": "^16.4.14" and "@types/react-dom": "^16.0.7" but this error persists.

What else can I do? Where is this error coming from? Where do I need to raise the awareness?

@Spenhouet
Copy link

For me the workaround is adding "skipLibCheck": true to tsconfig.json.

https://stackoverflow.com/a/52404148/2230045

@Beraliv
Copy link

Beraliv commented Dec 5, 2018

For me the workaround is adding "skipLibCheck": true to tsconfig.json.

https://stackoverflow.com/a/52404148/2230045

This isn't good workaround
Better not use Typescript then

@ChristianIvicevic
Copy link

If you happen to use yarn, then add the following to your package.json:

"resolutions": {
    "@types/react": "^16.7.18"
},

You get the error since yarn is incorrectly resolving multiple versions of the same package instead of just using one.

@khaziwallis
Copy link

add skipLibCheck": true to tsconfig.js is one solution, but better to solve via adding resolutions in package.json.

"resolutions": { "@types/react": "^16.7.18" },

@ChristianIvicevic
Copy link

@khaziwallis This is virtually the same as my suggestion in the previous comment :)

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