老师 开发完组件后 build 出现的问题,生成storybook这些没有问题

来源:12-6 驯服 tsc - tsconfig 编写第二部分

想翻身的码工

2020-04-23

“scripts”: {
“start”: “react-scripts start”,
“clean”: “rimraf ./dist”,
“build”: “npm run clean && npm run build-ts && npm run build-css”,
“test”: “react-scripts test”,
“eject”: “react-scripts eject”,
“build-ts”: “tsc -p tsconfig.build.json”,
“build-css”: “node-sass ./src/styles/index.scss ./dist/index.css”,
“storybook”: “start-storybook -p 9009 -s public”,
“build-storybook”: “build-storybook -s public”
}

node_modules/@types/react-transition-group/node_modules/@types/react/index.d.ts:3134:13 - error TS2717: Subsequent property
declarations must have the same type. Property ‘view’ must be of type ‘SVGProps’, but here has type ‘SVGProps’.

写回答

1回答

张轩

2020-04-24

同学你好 google 以后得到了如下答案,你可以试试 https://github.com/DefinitelyTyped/DefinitelyTyped/issues/24711#issuecomment-379167539

你是否使用 yarn 来安装管理包?

Try deleting your yarn.lock and let it create a fresh one, then it worked for me with the most recent @types/react version.


删除 yarn.lock 文件以后,重新安装依赖试一试

0
1
想翻身的码工
非常感谢!
2020-04-24
共1条回复

React18+TS高仿AntD从零到一打造组件库

设计,开发,测试,发布再到 CI/CD,从0到1造轮子

2136 学习 · 959 问题

查看课程