Skip to content

Instantly share code, notes, and snippets.

@jhannes
Last active October 29, 2020 23:02
Show Gist options
  • Save jhannes/3839d4e63e3e1c69b19ffe72095b1d92 to your computer and use it in GitHub Desktop.
Save jhannes/3839d4e63e3e1c69b19ffe72095b1d92 to your computer and use it in GitHub Desktop.
Localization with TypeScript and React context
export default function App() {
const [language, setLanguage] = useState(english);
return (
<ApplicationTextsContext.Provider value={language}>
<div className="App">
<MainPage />
<SelectLanguage onChangeLanguage={setLanguage} />
</div>
</ApplicationTextsContext.Provider>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment