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

v6 types break react-docgen-typescript prop inference #4217

Closed
macko911 opened this issue Nov 23, 2023 · 0 comments
Closed

v6 types break react-docgen-typescript prop inference #4217

macko911 opened this issue Nov 23, 2023 · 0 comments

Comments

@macko911
Copy link

macko911 commented Nov 23, 2023

Reopening already reported and fixed issue #3813

The issue was fixed in 6.0.0-beta.3 but got broken with the next beta release 6.0.0-beta.4

I've used git bisect and identified that this got broken in fe4ad7b

Edit: playing around with the PolymorphicComponentProps type I found that this is caused by using Omit (in this case FastOmit) and it is a documented issue in the docgen library styleguidist/react-docgen-typescript#335
I don't think there's anything to be done on the part of styled-components.

Environment

System:

  • OS: macOS 13.4.1
  • CPU: (8) arm64 Apple M1 Pro
  • Memory: 83.47 MB / 16.00 GB
  • Shell: 5.9 - /bin/zsh

Binaries:

  • Node: 20.8.0 - ~/.nvm/versions/node/v20.8.0/bin/node
  • Yarn: 1.22.0 - /usr/local/bin/yarn
  • npm: 10.2.3 - ~/.nvm/versions/node/v20.8.0/bin/npm

npmPackages:

  • styled-components: 6.1.0 => 6.1.0

Reproduction

I have written a basic failing test in #4218

Alternatively here's a codesandbox

https://codesandbox.io/p/github/macko911/react-docgen-typescript-styled-components-6/main

Steps to reproduce

Run npm run docgen to log the generated props.

Expected Behavior

Generated props for ButtonStyled: theme, as, forwardedAs, primary, backgroundColor, size, label

Actual Behavior

Generated props for ButtonStyled: theme, as, forwardedAs
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

1 participant