You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
I like the reasoning behind the no-default-export rule. But the React code-splitting feature (using React.lazy) seems to require the use of default exports. This is documented here:
Hi @benny-medflyt! You can always disable the rule. Different codebases have different styles, and there's no single rule or ruleset that works for everyone.
#4305 tracks relaxing these stylistic preferences in the default ruleset.
Thanks for the response. I realize that this rule can be disabled.
I actually strongly believe in the reasoning behind the "no-default-export" rule, and agree that default exports should never be used. I opened this issue to check with the community if anyone has a recommendation for how to use "React.lazy" with named exports.
I looked at the code of "React.lazy" and I think it should be possible to re-implement it to so that it does not require default exports. I wonder if anyone has already done this.
Thank you
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I like the reasoning behind the no-default-export rule. But the React code-splitting feature (using
React.lazy
) seems to require the use of default exports. This is documented here:https://reactjs.org/docs/code-splitting.html#named-exports
I was wondering if anyone else has any thoughts on this, or ways to still use named exports with React code splitting. Thank you
The text was updated successfully, but these errors were encountered: