-
-
Notifications
You must be signed in to change notification settings - Fork 298
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
Did not recognize object of type "ObjectTypeSpreadProperty" #449
Comments
you can use the type Props = {
className?: string,
onChange?: (checked: boolean, value?: string | number) => void,
skin: 'dark' | 'light',
} & SwitchProps; or the interface syntax: interface Props extends SwitchProps {
className?: string,
onChange?: (checked: boolean, value?: string | number) => void,
skin: 'dark' | 'light',
}; it won't show props from |
The And if the interface syntax does also not show the props, it works as well as it does currently. |
I found the same problem! To debug, I create a unit test for the this issue at https://github.com/imdreamrunner/react-docgen/pull/1/files The test case is very simple
The error is that "orange" was not in the result.
However if we look at the same test file getFlowType-test.ts, object spread is actually supported if using with $Keys. The test case below is working as expected (all three keys are returned as a union type).
|
I am using the
react-styleguidist
package, which makes use ofreact-docgen
. When I want to build my styleguide, I get the following error:I am using flow for static type checks in this project, and I assume the error is because of type definitions using the spread operator, in this specific case:
Is there a reason this is not supported, or is this an error?
The text was updated successfully, but these errors were encountered: