Skip to content

fix: Ignore assignment to non-identifier/literals #305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 24, 2018

Conversation

yungsters
Copy link
Contributor

Currently, react-docgen fatals on components assigned to non-identifier/literals. For example:

Foo.Bar = () => {};
// TypeError: Argument must be an Identifier or a Literal

This fixes it by checking the left expression of the assignment before attempting to extract its name.

Test Plan:

yarn test
yarn flow
yarn lint

@yungsters yungsters requested review from danez and fkling October 23, 2018 04:09
@danez
Copy link
Collaborator

danez commented Oct 24, 2018

Thanks

@danez danez merged commit d25d262 into reactjs:master Oct 24, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants