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

'RangePicker' cannot be used as a JSX component. #35788

Closed
kirill-linnik opened this issue May 28, 2022 · 4 comments
Closed

'RangePicker' cannot be used as a JSX component. #35788

kirill-linnik opened this issue May 28, 2022 · 4 comments

Comments

@kirill-linnik
Copy link

Reproduction link

https://github.com/kirill-linnik/react-redux/tree/main/src

Steps to reproduce

run yarn then yarn start. during compile time you get:

[tsl] ERROR in Main.tsx(28,8)
TS2786: 'RangePicker' cannot be used as a JSX component.
Its instance type 'Component<RangePickerProps, unknown, any> & CommonPickerMethods' is not a valid JSX element.
The types returned by 'render()' are incompatible between these types.

What is expected?

No compile error

What is actually happening?

While this issue claimed to be fixed here: #34973 I still see it is not the case in the latest library (4.20.6). is it some regression?

p.s. yarn.lock and node_modules where deleted prior the test, so it is an absolutely clean and fresh version

Environment Info
antd 4.20.6
React 18
System any
Browser any
@github-actions
Copy link
Contributor

@afc163
Copy link
Member

afc163 commented May 28, 2022

#35441 (comment)

@kirill-linnik
Copy link
Author

#35441 (comment)

great point. updated react types and error is gone. thank you!

@gabrielopeyemi
Copy link

I ran "preinstall": "npx npm-force-resolutions" but it throw few errors, errors are mainly using hooks wrongly, after fixing I ran yarn add @types/react@latest

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

3 participants