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

我不用webpack编译,直接用tsc编译会报以下错误,请问是什么原因? #6

Open
lusess123 opened this issue May 24, 2017 · 2 comments

Comments

@lusess123
Copy link

lusess123 commented May 24, 2017

node_modules/@ types/react-router/lib/Router.d.ts(4,5): error TS2305: Module '"d:/dva/dva-boilerplate-typescript-master/node_modules/@types/react-router-redux/node_modules/@types/history/index"' has no exported member 'QueryString'.
node_modules/@ types/react-router/lib/Router.d.ts(112,26): error TS2702: 'History' only refers to a type, but is being used as a namespace here.
node_modules/@ types/react-router/lib/Router.d.ts(112,48): error TS2702: 'History' only refers to a type, but is being used as a namespace here.
node_modules/@ types/react-router/lib/Router.d.ts(112,64): error TS2702: 'History' only refers to a type, but is being used as a namespace here.
node_modules/@ types/react-router/lib/Router.d.ts(113,26): error TS2702: 'History' only refers to a type, but is being used as a namespace here.
node_modules/@ types/react-router/lib/Router.d.ts(113,48): error TS2702: 'History' only refers to a type, but is being used as a namespace here.
node_modules/@ types/react-router/lib/Router.d.ts(113,64): error TS2702: 'History' only refers to a type, but is being used as a namespace here.
node_modules/@ types/react-router/lib/useRouterHistory.d.ts(3,60): error TS2314: Generic type 'CreateHistory' requires 2 type argument(s).
node_modules/@ types/react-router/lib/useRoutes.d.ts(4,46): error TS2314: Generic type 'CreateHistory' requires 2 type argument(s).
node_modules/@ types/react-router/lib/useRoutes.d.ts(4,67): error TS2314: Generic type 'CreateHistory' requires 2 type argument(s).

@lusess123
Copy link
Author

我感觉 是否是 ts 文件写得不够正规

@lusess123
Copy link
Author

解决了,把
import { routerRedux, Router, RouteProps } from 'dva/router';

改成
`import { Router, RouteProps } from 'react-router';

import * as routerRedux from 'react-router-redux';`

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

1 participant