react-polymorphic-box icon indicating copy to clipboard operation
react-polymorphic-box copied to clipboard

displayName and propTypes are not allowed on forwardRef component

Open tu4mo opened this issue 3 years ago • 3 comments

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 avatar Dec 19 '20 12:12 tu4mo

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.

kripod avatar Dec 19 '20 17:12 kripod

Awesome! Looking forward to it.

tu4mo avatar Dec 19 '20 19:12 tu4mo

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

kripod avatar Dec 27 '20 18:12 kripod