degmods.com/src/App.tsx
2024-10-23 18:00:53 +02:00

28 lines
655 B
TypeScript

import { RouterProvider } from 'react-router-dom'
import { useEffect } from 'react'
import { router } from 'routes'
import './styles/styles.css'
function App() {
useEffect(() => {
// Find the element with id 'root'
const rootElement = document.getElementById('root')
if (rootElement) {
// Add the class to the element
rootElement.classList.add('bodyMain')
}
// Cleanup function (optional): Remove the class when the component unmounts
return () => {
if (rootElement) {
rootElement.classList.remove('bodyMain')
}
}
}, [])
return <RouterProvider router={router} />
}
export default App