Created
February 12, 2019 00:48
-
-
Save helloanil/82da2e08fbd362802987c836bb586c5d to your computer and use it in GitHub Desktop.
CRA-I18N App.js - finishing translations
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, { useContext } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
import { I18nContext } from './i18n'; | |
import LanguageSelect from './components/LanguageSelect'; | |
const App = () => { | |
const { translate } = useContext(I18nContext); | |
return ( | |
<div className="App"> | |
<header className="App-header"> | |
<img src={logo} className="App-logo" alt="logo" /> | |
<LanguageSelect /> | |
<p>{translate('edit_and_save')}</p> | |
<a | |
className="App-link" | |
href="https://reactjs.org" | |
target="_blank" | |
rel="noopener noreferrer" | |
> | |
{translate('learn_react')} | |
</a> | |
</header> | |
</div> | |
); | |
}; | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment