Nach über Typisierungen Installation ich den unten Fehler im Terminal erhaltenReagieren Typoskript Typisierungen nicht
Terminal-Fehler
error TS2320: Interface 'Element' cannot simultaneously extend types 'ReactElement<any>' and 'ReactElement<any>'.
Named property 'type' of types 'ReactElement<any>' and 'ReactElement<any>' are not identical.
ERROR in /Users/ajvivek/Dev/ES6/motionize-code/typings/globals/react/index.d.ts
(2375,5): error TS1036: Statements are not allowed in ambient contexts.
ERROR in /Users/ajvivek/Dev/ES6/motionize-code/typings/globals/react-dom/index.d.ts
(69,5): error TS2309: An export assignment cannot be used in a module with other exported elements.
ERROR in /Users/ajvivek/Dev/ES6/motionize-code/node_modules/@types/react-dom/index.d.ts
(19,31): error TS2315: Type 'DOMAttributes' is not generic.
ERROR in /Users/ajvivek/Dev/ES6/motionize-code/node_modules/@types/react-dom/index.d.ts
(44,60): error TS2315: Type 'DOMAttributes' is not generic.
ERROR in /Users/ajvivek/Dev/ES6/motionize-code/node_modules/@types/react/index.d.ts
(2368,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'a' must be of type 'HTMLProps<HTMLAnchorElement>', but here has type 'HTMLProps<HTMLAnchorElement>'.
ERROR in /Users/ajvivek/Dev/ES6/motionize-code/node_modules/@types/react/index.d.ts
(2369,13): error TS2403: Subsequent variable declarations must have the same type. Variable 'abbr' must be of type 'HTMLProps<HTMLElement>', but here has type 'HTMLProps<HTMLElement>'.
index.d.ts /// <reference path="globals/react/index.d.ts" /> /// <reference path="globals/react-dom/index.d.ts" />
TSconfig. json
{
"compilerOptions": {
"module": "commonjs",
"sourceMap": true,
"noImplicitAny": true,
"target": "es5",
"jsx": "react"
},
"files": [
"./app/app.tsx",
"./app/Hello.tsx",
"typings/index.d.ts"
],
"exclude": [
"node_modules"
]
}
Ich habe die Dokumentation in https://www.typescriptlang.org/docs/handbook/react-&-webpack.html
Nicht sicher zu befolgen, was ich verpasst haben?
konfrontiert jemand dieses Problem?
warum ohne Sie "Typisierungen/index.d.ts"? dies ist der Einstiegspunkt aller Typisierungen, auch müssen Sie nicht die Dateien Abschnitt angeben, webpack werden die .ts und .tsx in Projektverzeichnis Auto suchen und kompilieren sie – abhirathore2006
Sie immer vorformulierten die verwenden können, einfach mal googlen Typoskript vorformulierten reagieren – abhirathore2006
Sind Sie sicher, dass Sie das Tutorial genau befolgt haben? Es verwendet keine Typings mehr, während Ihr 'tsconfig.json' anscheinend einen verwendet. Obwohl es auch implizit ist, soll TypeScript 2.0 verwendet werden. (Sie sollten auch nicht sowohl ein "Datei" -Feld als auch ein "Ausschließen" -Feld benötigen - eines wird ignoriert). –