-
Notifications
You must be signed in to change notification settings - Fork 198
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
Support ChainExpression
type for optional chaining
#383
Comments
1 task
🙏 anything i can do to help with this? |
I made a PR for a possible fix here. |
Thank you @ethancrook99 and @benjamn ❤️ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Feature request or bug?
[email protected] changed how optional chaining gets represented in an AST. Previously the optional chain was represented as an
OptionalMemberExpression
, now the optional chain is broken into two nodes aChainExpression
and aMemberExpression
.I asked babel if this was a breaking change and they clarified that this is an intentional change. See Babel issue #11908
I stumbled upon this while trying to use react-doc-gen against a component with optional chanining and the ast-types library that it uses fails when it tries to understand the 'ChainExpression' type. See react-doc-gen issue #463
I'm currently working around this issue by locking in the projects babel dependencies in the package.json
For example:
However this isn't a good long term fix. I would be ideal if ast-types was updated to support the
chainExpression
type.The text was updated successfully, but these errors were encountered: