Closed
Description
Setup:
- Create a project using allowSyntheticDefaultImports
- Create a component file in that project which imports React using a synthetic default import:
import React from 'react';
and add a component which extendsReact.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!
I added a PR just to demonstrate this issue: #101
Metadata
Metadata
Assignees
Labels
No labels