Closed SukkaW closed 1 month ago
Yeah this pattern should be allowed to
@ArnaudBarre I've created a PR #45 to fix this issue.
A minor problem is that the PR does not handle React.memo() only memo() correctly
ah yeah I never use this pattern, I still hope that one day React will be ESM 😂 but should be supported anyway, I'll do a quick fix
When will this fix be available? I just tried out this plugin today and was stumped why I was getting errors with
export default React.memo(MyComponent);
Fast refresh only works when a file only exports components. Move your component(s) to a separate file. Fast refresh can't handle anonymous components. Add a name to your export.
Sorry I though I'll do it directly and forgot about it! Available in 0.4.10 thanks to @SukkaW!
Thanks to both of you!
See also #27.
Example code:
And minimum reproduction on ESLint REPL.