at main 774 B view raw
1/** 2 * This file is the entry point for the React app, it sets up the root 3 * element and renders the App component to the DOM. 4 * 5 * It is included in `src/index.html`. 6 */ 7 8import { StrictMode } from "react"; 9import { createRoot } from "react-dom/client"; 10import { App } from "./App"; 11import { AtProtoProvider } from "atproto-ui" 12 13const elem = document.getElementById("root")!; 14const app = ( 15 <StrictMode> 16 <AtProtoProvider> 17 <App /> 18 </AtProtoProvider> 19 </StrictMode> 20); 21 22if (import.meta.hot) { 23 // With hot module reloading, `import.meta.hot.data` is persisted. 24 const root = (import.meta.hot.data.root ??= createRoot(elem)); 25 root.render(app); 26} else { 27 // The hot module reloading API is not available in production. 28 createRoot(elem).render(app); 29}