Skip to content
This repository has been archived by the owner on Nov 10, 2020. It is now read-only.

@types/react/index.d.ts compile failure #36

Open
jtheisen opened this issue Aug 12, 2017 · 2 comments
Open

@types/react/index.d.ts compile failure #36

jtheisen opened this issue Aug 12, 2017 · 2 comments

Comments

@jtheisen
Copy link

jtheisen commented Aug 12, 2017

When I compile a project depending on the latest version of flexbox-react (4.4.0), the compile fails with a lot of error messages like this:

h1: React.DetailedHTMLProps<React.HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>;
                 ~~

node_modules/flexbox-react/node_modules/@types/react/index.d.ts(3452,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'h1'
must be of type 'DetailedHTMLProps<HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>', but here has type 'DetailedHTMLProps<HTMLAttributes<HTMLHeadingEleme
nt>, HTMLHeadingElement>'.

I'm using Typescript 2.4.2.

The react I have in my own application is 16.0.2, although I don't think that should be relevant.

I'm still relatively new to Typescript and npm, so it may be not a problem with flexbox-react but something I do wrong.

@dylhunn
Copy link

dylhunn commented Aug 22, 2017

I am having an identical issue, in which it is "redeclared with a different type," despite identical types.

(3514,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'textarea' must be of type 'DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>', but here has type 'DetailedHTMLProps<TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>'.

@ssured
Copy link

ssured commented Sep 8, 2017

Same errors for me. Typescript 2.5 fails, 2.4 works for me. Upgrading the @types/react typings to v16 works for me, v15.6 still fails.
I guess these lines need an update

"@types/react": "^15.0.21",
"@types/react-dom": "^0.14.23"

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

No branches or pull requests

3 participants