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
Try to resolve static values inside PropType "oneOf"
A common pattern is to write:
```javascript
React.PropTypes.oneOf([TYPES.FOO, TYPES.BAR]);
// or:
var TYPES = ["FOO", "BAR"];
React.PropTypes.oneOf(TYPES);
// or:
var TYPES = ["A", "B"];
var MORE = [...TYPES, "C"];
React.PropTypes.oneOf(MORE);
```
etc.
This change tries to resolve all identifiers (be it the arguments
themselves or identifier inside an ArrayExpression) to their value
in order to be able to generate better documentation for "oneOf"
propTypes that reference static values.
This does not work for values that are imported from external files
and also does not work for values that are computed
(as in `Object.keys(TYPES)` or `_.values(TYPES)`).
In those cases it will just print the value with the `computed` flag set
to true.
0 commit comments