eco-repositories / eco-monorepo

3 stars 0 forks source link

Adopt a convention to also export client components using `export default` #216

Open parzhitsky opened 6 months ago

parzhitsky commented 6 months ago

This would drastically simplify the *.lazy.tsx files:

  export const Home: React.FC = () => { … }

+ export default Home
- export const Home = React.lazy(async () => {
-   const module = await import('./home.js')

-   return {
-     default: module.Home,
-   }
- })
+ export const Home = React.lazy(async () => await import('./home.js'))
parzhitsky commented 2 weeks ago

It is unclear how to enforce the convention. One way is to create an ESLint rule (see #109)