brigand / brigand/babel-plugin-flow-react-proptypes

Add support for recursive data types

Open
#218 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
427
Forks
42
PR merge metrics
No merged PRs in 30d

Description

The following code:
```
type NestedArray = (T | NestedArray)[];

export type Props = {
numbers: NestedArray,
};
```
produces the following error:
```
RangeError: Maximum call stack size exceeded
at Array.map ()

20 | }
21 | else if (node.type === 'UnionTypeAnnotation') {
> 22 | const realTypes = node.types.map(n => mapGenericToRealType(n, typeParamMapping));
| ^
23 | const newNode = Object.assign({}, node, {
24 | types: realTypes,
25 | });

at map (src/convertToPropTypes.js:22:34)
...
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.