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

displayName and propTypes are not allowed on forwardRef component #22

Open
tu4mo opened this issue Dec 19, 2020 · 3 comments
Open

displayName and propTypes are not allowed on forwardRef component #22

tu4mo opened this issue Dec 19, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@tu4mo
Copy link

tu4mo commented Dec 19, 2020

Description

Using displayName and propTypes on a forwardRef component shows error. I guess this is more of an issue with the example code than this library.

Reproduction

https://codesandbox.io/s/typescript-as-prop-with-react-polymorphic-box-forked-hw0l5?file=/src/App.tsx

Expected behavior

displayName and propTypes should be allowed.

Actual behavior

displayName and propTypes are not allowed.

@tu4mo tu4mo added the bug Something isn't working label Dec 19, 2020
@kripod
Copy link
Owner

kripod commented Dec 19, 2020

Thank you for the report! I’ve just started to work on refactoring this library into a new, smaller and better one. The work may take a while, but until then, I’m not planning to fix the examples provided for this library.

@tu4mo
Copy link
Author

tu4mo commented Dec 19, 2020

Awesome! Looking forward to it.

@kripod
Copy link
Owner

kripod commented Dec 27, 2020

@tu4mo I’ve just released react-polymorphic-types which includes types specialized for React.forwardRef, React.memo and React.lazy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants