PluginProbe
Yatra – Travel Booking & Tour Operator Software / 3.0.5
Yatra – Travel Booking & Tour Operator Software v3.0.5
3.0.16 3.0.15 3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 All 84 releases
yatra / resources / js / main.tsx

main.tsx in Yatra – Travel Booking & Tour Operator Software 3.0.5, at resources/js/main.tsx

49 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React from "react";
2 import ReactDOM from "react-dom/client";
3 import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
4 import App from "./App";
5 import { ToastProvider } from "./components/ui/toast";
6 import "./css/index.css";
7
8 // Create React Query client with proper configuration
9 let queryClient: QueryClient;
10
11 try {
12 queryClient = new QueryClient({
13 defaultOptions: {
14 queries: {
15 refetchOnWindowFocus: false,
16 retry: 1,
17 staleTime: 5 * 60 * 1000, // 5 minutes
18 },
19 },
20 });
21 } catch (error) {
22 console.error("Error initializing QueryClient:", error);
23 // Fallback: create with minimal config
24 queryClient = new QueryClient();
25 }
26
27 // Get mount point
28 const rootElement = document.getElementById("yatra-app-root");
29
30 if (rootElement) {
31 try {
32 const root = ReactDOM.createRoot(rootElement);
33
34 root.render(
35 <React.StrictMode>
36 <QueryClientProvider client={queryClient}>
37 <ToastProvider>
38 <App />
39 </ToastProvider>
40 </QueryClientProvider>
41 </React.StrictMode>,
42 );
43 } catch (error) {
44 console.error("Error rendering React app:", error);
45 rootElement.innerHTML =
46 '<div style="padding: 40px; text-align: center;"><h2>Error loading Yatra Admin</h2><p>Please refresh the page or contact support.</p></div>';
47 }
48 }
49