kripod / kripod/react-polymorphic-box

displayName and propTypes are not allowed on forwardRef component

Open
#22 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
TypeScript
Stars
346
Forks
14
PR merge metrics
No merged PRs in 30d

Description

## 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.

Contributor guide

Open the contributing guide

Research direction

Reproduce the error in the linked CodeSandbox, then trace the TypeScript definitions used for the forwardRef component in this repository. Done means displayName and propTypes are accepted without errors while the existing polymorphic component typing behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.