-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
react_refresh: Don't visit arrow function nodes (#37)
Since atoms created in a function context are new atoms, there's nothing in the arrow function sub-tree that we should transform. The default behavior seems to be to visit everything, whereas an empty impl stops the walk. Another driveby fix: store previous `top_level` in `visit_mut_stmts` instead of always resetting it to `true`. I don't have a failing test for this (so it might be fine), but it's a pattern that's explicitly called out in the docs [0]. [0]: https://swc.rs/docs/plugin/ecmascript/cheatsheet#make-your-handlers-stateless Fixes #36
- Loading branch information
1 parent
9a4d555
commit 2bde4e9
Showing
1 changed file
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters