ant-design: Typescript error for some components in v3.10.0

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.10.0

Environment

5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36

Reproduction link

https://github.com/ant-design/ant-design/blob/master/components/breadcrumb/Breadcrumb.tsx

Steps to reproduce

when I run my project, if import any antdesign component will show error, otherwise is fine error message is

/node_modules/antd/lib/breadcrumb/Breadcrumb.d.ts
ERROR in /node_modules/antd/lib/breadcrumb/Breadcrumb.d.ts(25,52):
TS2694: Namespace '"/node_modules/@types/prop-types/index"' has no exported member 'ReactNodeLike'.

What is expected?

it should use PropTypes.ReactNode, not PropTypes.ReactNodeLike

What is actually happening?

type error

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 6
  • Comments: 25 (8 by maintainers)

Most upvoted comments

Hi guys, I found another solution, it’s not typescript version issue, try to add "skipLibCheck": true inside your tsconfig.json file in compilerOptions field, I think it will be solved.

@KevinBon upgrade @types/prop-types to 15.5.6, reinstall and see whether the problem solved.

What’s your prop-types version and @types/react @types/prop-types?

@ycjcl868 I didn’t use @types/prop-types in my project, so right now I need to manually install this dependency, is it better if antd update @types/prop-types from 15.5.4 to 15.5.6 in antd package.json? https://github.com/ant-design/ant-design/blob/master/package.json