Flow typed JSX syntax regression in v1.6.0
See original GitHub issueRepro:
Input:
let child: Element<any> = <img src={url} key="img" />;
Error message:
SyntaxError: Unexpected token, expected , (1:32)
> 1 | let child: Element<any> = <img src={url} key="img" />;
| ^
If you add parentheses around the expression it will parse, but the output will not include the parentheses so the output is not parseable. A workaround that is idempotent with respect to prettier is to use an inline annotation.
let child = (<img src={url} key="img" />: Element<any>);
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Releases · flow-typed/flow-typed - GitHub
A central repository for Flow library definitions. Contribute to flow-typed/flow-typed development by creating an account on GitHub.
Read more >Flow to TypeScript migration journey - TkDodo's blog
We evaluated flow-to-ts, which could automatically migrate existing flow types to TypeScript. It worked quite well, but a lot of syntax errors ...
Read more >@babel/plugin-syntax-flow | Yarn - Package Manager
Fast, reliable, and secure dependency management.
Read more >Firebase JavaScript SDK Release Notes - Google
Fixed a regression that prevented Cloud Firestore from detecting the Authentication service during initialization, which prevented some writes from being sent.
Read more >Changelog - JavaScript Standard Style
Fix: Ensure we support all of the latest syntax that ESLint 8 includes, ... Update eslint-config-standard-jsx from 10.0.0 to 11.0.0-0 to adapt to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@etrepum yeah I fixed that bug recently too, thanks again for the bug report!
I just shipped 1.6.1 that contains this fix! Thanks for reporting it!