/** * Main application content with all providers and UI layers. * Renders the router with context providers, notifications, and overlays. * @returns Root React element with nested providers and router. * @source */ functionAppContent() { const { updateAvailable, updateInfo, downloadProgress, isDownloading, isDownloaded, error, downloadUpdate, installUpdate, dismissUpdate, } = useAutoUpdater();
/** * Application wrapper component. * Ensures storage is initialized and handles React strict mode rendering. * Storage initialization occurs in renderer.ts before this component mounts. * @returns Application content or splash screen. * @source */ exportdefaultfunctionApp() { // State tracks if storage is ready; normally true immediately // Used to handle strict mode remounting in development const [isStorageReady, setIsStorageReady] = React.useState(true);
React.useEffect(() => { // Storage should already be initialized by renderer.ts before App mounts // This state ensures proper hydration in React strict mode setIsStorageReady(true); }, []);
if (!isStorageReady) { return <StorageSplash />; }
return <AppContent />; }
/** * Mount the React application to the DOM. * Renders the App component in strict mode for development safety checks. * @source */ constcontainer = document.getElementById("app"); if (container) { constroot = createRoot(container); root.render( <React.StrictMode> <App /> </React.StrictMode>, ); }
Description
Main React application component. Sets up all context providers, routing, and UI overlays for the KenmeiToAnilist application.
Source