Skip to content

Commit 6eea533

Browse files
danieldelcoreNoviny
authored andcommitted
work around for null typescript definitions (#90)
1 parent 58d12d8 commit 6eea533

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ "releases": [{ "name": "extract-react-types", "type": "patch" }], "dependents": [] }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Introduces a workaround for TypeScript types that are unable to be resolved and return null

packages/extract-react-types/src/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,14 @@ function convertReactComponentClass(path, context) {
218218
...context,
219219
mode: 'value'
220220
});
221+
222+
/**
223+
* FIXME: It's possible to get nulls in the members array when TS is unable
224+
* to resolve type definitions of non-relative module imports
225+
* See: https://github.com/atlassian/extract-react-types/issues/89
226+
**/
227+
classProperties.value.members = classProperties.value.members.filter(m => !!m);
228+
221229
return addDefaultProps(classProperties, defaultProps);
222230
}
223231

0 commit comments

Comments
 (0)