| @@ -7,8 +7,9 @@ | ||
| 7 | 7 | import ReactDOM from "react-dom/client"; |
| 8 | 8 | import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; |
| 9 | 9 | import AccountPage from "./pages/AccountPage"; |
| 10 | 10 | import { ToastProvider } from "./components/ui/toast"; |
| 11 | +import { ErrorBoundary } from "./components/ErrorBoundary"; | |
| 11 | 12 | import { __ } from "./lib/i18n"; |
| 12 | 13 | import "./css/index.css"; |
| 13 | 14 | |
| 14 | 15 | // Create React Query client |
| @@ -25,8 +26,13 @@ | ||
| 25 | 26 | // Get mount point |
| 26 | 27 | const rootElement = document.getElementById("yatra-account-page-root"); |
| 27 | 28 | |
| 28 | 29 | if (rootElement) { |
| 30 | + // Opt out of browser auto-translation so it never rewrites React-managed | |
| 31 | + // text nodes (which otherwise causes "removeChild" reconciliation crashes). | |
| 32 | + rootElement.setAttribute("translate", "no"); | |
| 33 | + rootElement.classList.add("notranslate"); | |
| 34 | + | |
| 29 | 35 | try { |
| 30 | 36 | const root = ReactDOM.createRoot(rootElement); |
| 31 | 37 | |
| 32 | 38 | root.render( |
| @@ -32,9 +38,11 @@ | ||
| 32 | 38 | root.render( |
| 33 | 39 | <React.StrictMode> |
| 34 | 40 | <QueryClientProvider client={queryClient}> |
| 35 | 41 | <ToastProvider> |
| 36 | - <AccountPage /> | |
| 42 | + <ErrorBoundary> | |
| 43 | + <AccountPage /> | |
| 44 | + </ErrorBoundary> | |
| 37 | 45 | </ToastProvider> |
| 38 | 46 | </QueryClientProvider> |
| 39 | 47 | </React.StrictMode>, |
| 40 | 48 | ); |