Definitelytyped: Suggestion: Specify carat version of `@types/react` for each release of `@types/react-select`

Created on 2 Aug 2017  路  6Comments  路  Source: DefinitelyTyped/DefinitelyTyped

In the package.json for this package, currently there is:

"dependencies": {
    "@types/react": "*"
},

It would be better to use carat ranges than the current wildcard for @types/react in the package.json for this package, because otherwise say for example the user is on React 15, and React 16 is released, and thus then the @types/react version is 16, causing this error:

node_modules/@types/react-select/node_modules/@types/react/index.d.ts
(3422,13): error TS2403: Subsequent variable declarations must have the same type.  Variable 'a' must be of type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>', but here has type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>

Using: ts-loader: Using [email protected]

  • Authors: @Hesquibet, @giladgray, @iebaker, @tdreyno @skirsdeda, @vujevits, @devrelm, @MartynasZilinskas

Most helpful comment

I'm not using react-select but I'm having the exact same issue:

        "@types/node": "^8.0.19",
        "@types/react": "^15.6.1",
        "@types/react-bootstrap": "^0.0.52",
        "@types/react-dom": "^15.5.2",
        "@types/recompose": "^0.23.3",
        "@types/webpack-env": "^1.13.0",
        "react": "^15.6.1",
        "react-apollo": "^1.4.10",
        "react-bootstrap": "^0.31.2",
        "react-dom": "^15.6.1",
        "recompose": "^0.24.0"
Error:(3422, 13) TS2403:Subsequent variable declarations must have the same type.  Variable 'a' must be of type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>', but here has type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>'.

[...]

Error:(3584, 13) TS2403:Subsequent variable declarations must have the same type.  Variable 'view' must be of type 'SVGProps<SVGViewElement>', but here has type 'SVGProps<SVGViewElement>'.

All 6 comments

See also: #18484

I'm not using react-select but I'm having the exact same issue:

        "@types/node": "^8.0.19",
        "@types/react": "^15.6.1",
        "@types/react-bootstrap": "^0.0.52",
        "@types/react-dom": "^15.5.2",
        "@types/recompose": "^0.23.3",
        "@types/webpack-env": "^1.13.0",
        "react": "^15.6.1",
        "react-apollo": "^1.4.10",
        "react-bootstrap": "^0.31.2",
        "react-dom": "^15.6.1",
        "recompose": "^0.24.0"
Error:(3422, 13) TS2403:Subsequent variable declarations must have the same type.  Variable 'a' must be of type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>', but here has type 'DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>'.

[...]

Error:(3584, 13) TS2403:Subsequent variable declarations must have the same type.  Variable 'view' must be of type 'SVGProps<SVGViewElement>', but here has type 'SVGProps<SVGViewElement>'.

Same bug with react-flatpickr @begincalendar

I'm having the exact same issue with vague type definitions giving duplicate errors, I want to die.

too sad! I have the same problem even though I didn't change anything. It just happens

This is pathetic. Open Source stinks

Was this page helpful?
0 / 5 - 0 ratings