Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flow] Resolve spread properties in object type (#339)
The new fixtures shows an example that currently fails with the error ``` TypeError: Argument must be an Identifier or a Literal at getNameOrValue (/home/fkling/git/react-docgen/dist/utils/getNameOrValue.js:40:13) at getPropertyName (/home/fkling/git/react-docgen/dist/utils/getPropertyName.js:34:40) at NodePath.path.get.each.param (/home/fkling/git/react-docgen/dist/utils/getFlowType.js:171:41) at NodePath.each (/home/fkling/git/react-docgen/node_modules/ast-types/lib/path.js:89:26) at Object.handleObjectTypeAnnotation [as ObjectTypeAnnotation] (/home/fkling/git/react-docgen/dist/utils/getFlowType.js:168:26) at getFlowTypeWithResolvedTypes (/home/fkling/git/react-docgen/dist/utils/getFlowType.js:274:35) at Object.handleGenericTypeAnnotation [as GenericTypeAnnotation] (/home/fkling/git/react-docgen/dist/utils/getFlowType.js:143:14) at getFlowTypeWithResolvedTypes (/home/fkling/git/react-docgen/dist/utils/getFlowType.js:274:35) at getFlowType (/home/fkling/git/react-docgen/dist/utils/getFlowType.js:305:16) at NodePath.functionExpression.get.each.paramPath (/home/fkling/git/react-docgen/dist/utils/getMethodDocumentation.js:43:39) ``` That's because the method is referencing the `Props` type, but is not setup to deal with spread properties (like the flowTypeHandler) is. This change adds similar logic to the object type resolver.
- Loading branch information