We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d0b47e commit 6a487a8Copy full SHA for 6a487a8
src/useImported.ts
@@ -114,6 +114,13 @@ export function useImported<T, K = T>(
114
useEffect(() => {
115
if (postEffectRef.current) {
116
executeLoadableEventually(loadable, () => settings.updateOnReload && update({}));
117
+ } else {
118
+ // initial render
119
+ // if it's already loading - do nothing
120
+ // however - if it's already loaded (cannot be so quick) - that's an indication of passed HMR event
121
+ if (!loadable.isLoading()) {
122
+ executeLoadableEventually(loadable, () => settings.updateOnReload && update({}));
123
+ }
124
}
125
126
postEffectRef.current = true;
0 commit comments