Last active
April 20, 2022 18:33
-
-
Save numoonchld/fac8a3b9ce1c26dd4fa64aa974c86cee to your computer and use it in GitHub Desktop.
React 18 - TS based index.js with Router
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// h/t: https://github.com/facebook/create-react-app/issues/12219#issuecomment-1085567299 | |
import { createRoot } from 'react-dom/client'; | |
import { BrowserRouter } from 'react-router-dom'; | |
import { StrictMode } from 'react'; | |
import App from './App'; | |
import reportWebVitals from './reportWebVitals'; | |
import './index.css'; | |
const container = document.getElementById('root'); | |
const root = createRoot(container as HTMLElement); | |
const app = ( | |
<StrictMode> | |
<BrowserRouter> | |
<App /> | |
</BrowserRouter> | |
</StrictMode> | |
); | |
root.render(app); | |
reportWebVitals(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment