React.Lazy component with other exports do not get refreshed
See original GitHub issueIf I have a component on the default export loaded lazily I am unable to see any refreshes if I also have any named exports.
const Component = lazy(() => import('./AComponent'))
The same component import normally will refresh as expected.
import Component from ./AComponent'
export const myNamedExport = {
one: 'one'
}
export default function AComponent() {
return <p>hello</p>;
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
React.Lazy component with other exports do not get refreshed
If I have a component on the default export loaded lazily I am unable to see any refreshes if I also have any...
Read more >Lazy loading React components - LogRocket Blog
Named exports for React components. At the moment, React.lazy() does not support using named exports for React components.
Read more >React.lazy without a default export - DEV Community
The React.lazy function lets you render a dynamic import as a regular component. Before: import OtherComponent from '.
Read more >Lazy loading React components with React.lazy
Take any component that you want to lazy load and change it to the following: - import MyComponent from './MyComponent'; + const MyComponent ......
Read more >Lazy Loading React Components (with react.lazy and suspense)
It is a new function in react that lets you load react components lazily through code splitting without help from any additional libraries....
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 FreeTop 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
Top GitHub Comments
Should be fixed in
0.5.0-beta.1
.Hm, I discovered that my situation is actually different than this one and am trying to narrow it down again. [edit: opened #299 ]
(A minimal repo I was using helped me discover the causes above, but it turns out my app’s problems were actually different than the minimal repo’s problems. 🙂 )