pashto-grammar/src/main.tsx

32 lines
764 B
TypeScript
Raw Normal View History

2023-02-04 12:20:48 +00:00
import React from 'react'
import ReactDOM from 'react-dom/client'
import App from './App'
import "bootstrap/dist/css/bootstrap.min.css";
import "@fortawesome/fontawesome-free/css/all.css";
import { registerSW } from "virtual:pwa-register";
import {
BrowserRouter,
} from "react-router-dom";
import { UserProvider} from "./user-context";
const updateSW = registerSW({
onNeedRefresh() {
if (confirm("New content available. Reload?")) {
updateSW(true);
}
},
onOfflineReady() {
console.log("offline ready");
},
});
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<BrowserRouter>
<UserProvider>
<App />
</UserProvider>
</BrowserRouter>
</React.StrictMode>,
);