Skip to content

Commit

Permalink
fix: Make index.tsx HMR compatible (#19660)
Browse files Browse the repository at this point in the history
Fixes #19657
  • Loading branch information
Artur- authored Jul 3, 2024
1 parent ba36f2e commit a8c89b4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ function App() {
return <RouterProvider router={router} />;
}

createRoot(document.getElementById('outlet')!).render(createElement(App));
const outlet = document.getElementById('outlet')!;
let root = (outlet as any)._root ?? createRoot(outlet);
(outlet as any)._root = root;
root.render(createElement(App));

0 comments on commit a8c89b4

Please sign in to comment.