Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save richard1230/c6e234a0765ef021beb72d342988451f to your computer and use it in GitHub Desktop.
Save richard1230/c6e234a0765ef021beb72d342988451f to your computer and use it in GitHub Desktop.
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<HashRouter> & Readonly<HashRouterProps>'.
代码地址: https://github.com/richard1230/ReactUI01
复现步骤:
1.git clone [email protected]:richard1230/ReactUI01.git
2.git checkout f806835fa72c4953e62eb09d17f5177d443847ec
3.yarn install
4.yarn start
报错:
TS2769: No overload matches this call.
Overload 1 of 2, '(props: HashRouterProps | Readonly<HashRouterProps>): HashRouter', gave the following error.
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<HashRouter> & Readonly<HashRouterProps>'.
Overload 2 of 2, '(props: HashRouterProps, context: any): HashRouter', gave the following error.
Type '{ children: Element; }' has no properties in common with type 'IntrinsicAttributes & IntrinsicClassAttributes<HashRouter> & Readonly<HashRouterProps>'.
我想要的效果---->没有错误
@richard1230
Copy link
Author

这个报错怎么解决

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment