Skip to content

Commit

Permalink
fix: move invalidate into accept callback
Browse files Browse the repository at this point in the history
  • Loading branch information
IanVS committed Sep 26, 2022
1 parent 4fb8155 commit 5d6b80e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/plugin-react/src/fast-refresh.ts
Expand Up @@ -100,14 +100,13 @@ function isReactRefreshBoundary(mod) {
return hasExports && areAllExportsComponents;
}
import(/* @vite-ignore */ import.meta.url).then(mod => {
import.meta.hot.accept();
import.meta.hot.accept(mod => {
if (isReactRefreshBoundary(mod)) {
${timeout}
} else {
import.meta.hot.invalidate();
}
})
});
`

export function addRefreshWrapper(
Expand Down

0 comments on commit 5d6b80e

Please sign in to comment.