ascoders / gaea-editor

Design websites in your browser. A smart web editor!
https://gaeajs.github.io/gaea-site/
MIT License
1.34k stars 222 forks source link

'ReactDOM' is declared but its value is never read #33

Open DrWYN opened 6 years ago

DrWYN commented 6 years ago

使用create-react-app-ts创建的ts项目,npm install gaea-editor后,index文件引入gaea-editor,npm start报错

index.tsx


import Editor from 'gaea-editor';

ReactDOM.render( , document.getElementById('root') as HTMLElement );



#### npm start
> ./node_modules/dob-react/src/connect.ts
(2,1): 'ReactDOM' is declared but its value is never read.
AIMentalModel commented 5 years ago

@DrWYN 是tslint语言检查的关系,修改一下tsconfig.json就可以了,主要删掉几个配置项,你可以借鉴一下.然后再安装几个需要的ts生命就行了. { "compilerOptions": { "baseUrl": ".", "outDir": "build/dist", "module": "esnext", "target": "esnext", "lib": [ "es5", "es6", "dom", "scripthost" ], "sourceMap": true, "allowJs": true, "jsx": "react", "moduleResolution": "node", "strictNullChecks": false, "forceConsistentCasingInFileNames": true, "noImplicitReturns": false, "noImplicitThis": true, "noImplicitAny": true, "suppressImplicitAnyIndexErrors": true, "experimentalDecorators": true, "skipLibCheck": true, }, "exclude": [ "build", "scripts", "acceptance-tests", "webpack", "jest", "src/setupTests.ts" ] }