Initial commit

This commit is contained in:
Ahmed Al-Taiar
2024-08-07 22:31:59 -04:00
commit 746a443ccd
50 changed files with 22362 additions and 0 deletions

24
web/src/entry.client.tsx Normal file
View File

@ -0,0 +1,24 @@
import { hydrateRoot, createRoot } from 'react-dom/client'
import App from './App'
/**
* When `#redwood-app` isn't empty then it's very likely that you're using
* prerendering. So React attaches event listeners to the existing markup
* rather than replacing it.
* https://react.dev/reference/react-dom/client/hydrateRoot
*/
const redwoodAppElement = document.getElementById('redwood-app')
if (!redwoodAppElement) {
throw new Error(
"Could not find an element with ID 'redwood-app'. Please ensure it " +
"exists in your 'web/src/index.html' file."
)
}
if (redwoodAppElement.children?.length > 0) {
hydrateRoot(redwoodAppElement, <App />)
} else {
const root = createRoot(redwoodAppElement)
root.render(<App />)
}