You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a component file in that project which imports React using a synthetic default import: import React from 'react'; and add a component which extends React.Component
Run react-docgen-typescript on this file
Expected behavior:
Props are successfully processed
Actual behavior:
No props are reported as existing on the component
FWIW, I don't actually know if this is an issue with this project. It seems to be a complex interaction of the typescript parser and this project which results in this behavior. I have been stepping through extractPropsFromTypeIfStatefulComponent and, in the failing case, instanceType.getProperty('props') returns null, but instanceType.getProperty('prop1') (or whatever an individual prop is called) returns the expected type for that individual property.
I'm happy to help in any way to figure this out, but I'm a bit stumped at the moment. Thanks!
Setup:
import React from 'react';
and add a component which extendsReact.Component
react-docgen-typescript
on this fileExpected behavior:
Props are successfully processed
Actual behavior:
No props are reported as existing on the component
FWIW, I don't actually know if this is an issue with this project. It seems to be a complex interaction of the typescript parser and this project which results in this behavior. I have been stepping through
extractPropsFromTypeIfStatefulComponent
and, in the failing case,instanceType.getProperty('props')
returns null, butinstanceType.getProperty('prop1')
(or whatever an individual prop is called) returns the expected type for that individual property.I'm happy to help in any way to figure this out, but I'm a bit stumped at the moment. Thanks!
I added a PR just to demonstrate this issue: #101
The text was updated successfully, but these errors were encountered: