Typescript-react-starter: Enzyme problem. Has no exported member 'AllHTMLAttributes'

Created on 2 Aug 2017  路  2Comments  路  Source: microsoft/TypeScript-React-Starter

I cloned the respository.
npm i
npm run start.

Failed to compile.

Error in C:projectsworkTypeScript-React-Starternode_modules@typesenzymeindex.d.ts
(13,35): error TS2305: Module '"C:/projects/work/TypeScript-React-Starter/node_modules/@types/react/index"' has no exported member 'AllHTMLAttributes'.

I am running windows 10. npm 5.3, node v6.9.5.

Most helpful comment

As stated in the PR:
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/3f1a9ccec07ab1f5c9518cee294792a03467373f

and here:

The interface for React.HTMLAttributes has been broken apart into multiple interfaces (as of @types/react-15.0.38), each specific to a particular DOM element type (SelectHTMLAttributes, TdHTMLAttributes, etc), and the unified interface with all of the possible DOM element attributes is now AllHTMLAttributes.
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/18269

upgrade your react type for something after @types/react-15.0.38

All 2 comments

As stated in the PR:
https://github.com/DefinitelyTyped/DefinitelyTyped/commit/3f1a9ccec07ab1f5c9518cee294792a03467373f

and here:

The interface for React.HTMLAttributes has been broken apart into multiple interfaces (as of @types/react-15.0.38), each specific to a particular DOM element type (SelectHTMLAttributes, TdHTMLAttributes, etc), and the unified interface with all of the possible DOM element attributes is now AllHTMLAttributes.
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/18269

upgrade your react type for something after @types/react-15.0.38

To solve the problem.
Install npm-check-updates (https://www.npmjs.org/package/npm-check-updates), then jump into your project folder and run:

npm-check-updates
And to update and save changes to your package.json file:

npm-check-updates -u

Was this page helpful?
0 / 5 - 0 ratings

Related issues

masters3d picture masters3d  路  6Comments

wilomgfx picture wilomgfx  路  6Comments

nikhilyeole1 picture nikhilyeole1  路  9Comments

user135711 picture user135711  路  6Comments

Yang09701194 picture Yang09701194  路  7Comments