Created
February 28, 2020 16:12
-
-
Save ashour/84194a6d910bdfec2a07d87d8fe8ef37 to your computer and use it in GitHub Desktop.
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
import React from "react"; | |
import { hydrate } from "react-dom"; | |
import { BrowserRouter } from "react-router-dom"; | |
import App from "./common/App"; | |
import { determineUserLang } from "./common/i18n"; | |
const lang = determineUserLang( | |
navigator.languages || [], | |
window.location.pathname, | |
); | |
hydrate( | |
<BrowserRouter basename={`/${lang}`}> | |
<App lang={lang} /> | |
</BrowserRouter>, | |
document.getElementById("root"), | |
); | |
if (module.hot) { | |
module.hot.accept(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment