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
cdeutsch opened this issue Aug 9, 2018 · 15 comments
Closed

Typing issues with Typescript 3 and new LibraryManagedAttributes feature #11697

cdeutsch opened this issue Aug 9, 2018 · 15 comments
Assignees

Comments

@cdeutsch
Copy link
Contributor

@cdeutsch 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

@huangbinjie huangbinjie commented Aug 10, 2018

I have the same issue.

3 similar comments
@fengweilin
Copy link

@fengweilin fengweilin commented Aug 11, 2018

I have the same issue.

@graykick
Copy link

@graykick graykick commented Aug 11, 2018

I have the same issue.

@danielg2002
Copy link
Contributor

@danielg2002 danielg2002 commented Aug 12, 2018

I have the same issue.

@IssueHuntBot
Copy link

@IssueHuntBot IssueHuntBot commented Aug 13, 2018

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

@yesmeck yesmeck closed this in be74114 Aug 13, 2018
@IssueHuntBot
Copy link

@IssueHuntBot IssueHuntBot commented Aug 13, 2018

@elie222
Copy link

@elie222 elie222 commented Aug 16, 2018

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

@cdeutsch
Copy link
Contributor Author

@cdeutsch cdeutsch commented Aug 17, 2018

@elie222 it should already be fixed.

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

@eloff
Copy link

@eloff 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

@Spenhouet Spenhouet commented Sep 19, 2018

@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

@Spenhouet Spenhouet commented Sep 19, 2018

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

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

@Beraliv
Copy link

@Beraliv 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

@ChristianIvicevic ChristianIvicevic commented Jan 5, 2019

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

@khaziwallis khaziwallis commented Jan 30, 2019

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

@ChristianIvicevic ChristianIvicevic commented Jan 30, 2019

@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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet