Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript + React 项目记录 #9

Open
huruji opened this issue Dec 1, 2018 · 5 comments
Open

Typescript + React 项目记录 #9

huruji opened this issue Dec 1, 2018 · 5 comments

Comments

@huruji
Copy link
Owner

huruji commented Dec 1, 2018

No description provided.

@huruji
Copy link
Owner Author

huruji commented Dec 1, 2018

react-router-dom 占位路径报错 Property 'match' does not exist on type 'Readonly<{children?:ReactNode}> & Readonly'

DefinitelyTyped/DefinitelyTyped#17355

https://stackoverflow.com/questions/50117006/reactjs-ts-property-match-does-not-exist-on-type-readonlychildrenreactno

@Quilljou
Copy link

Quilljou commented Dec 2, 2018

UI组价库的 devDependencies,peerDependencies, dependencies
UI 组件库依赖的框架(Vue, react)应该作为 peerDependencies,
同时也需要作为 devDependencies
dependencies 应该只有组件库真正在生产环境依赖的库

@huruji
Copy link
Owner Author

huruji commented Dec 6, 2018

循环固定次数,如12次,不要使用new Array(12).map,应该是使用Array.from({length:12}),empty的array根本不走map
image

@huruji
Copy link
Owner Author

huruji commented Dec 19, 2018

@Quilljou
Copy link

Quilljou commented Jan 7, 2019

Array.from, Map, String.prototype.startswith 这些作为标准库的一部分, ts 不编译是正常行为,需要我们自己引入垫子,class, () => 这种新语法就可以被正常编译

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants