Skip to content

Instantly share code, notes, and snippets.

@darde
Created August 7, 2018 18:53
Show Gist options
  • Save darde/b0b1a52b4f44b9d4bb3428541ed1cfc9 to your computer and use it in GitHub Desktop.
Save darde/b0b1a52b4f44b9d4bb3428541ed1cfc9 to your computer and use it in GitHub Desktop.
react-i18next-example/src/components/Home/index.jsx
import React from 'react';
import { translate } from 'react-i18next';
import photo from './photo.jpg';
const Home = ({ t }) => (
<div className='preview'>
<h1>{t('home.title')}</h1>
<div>
<figure className='center'>
<img src={photo} alt={t('home.figure.alt')} />
</figure>
</div>
<p className='center'>{t('home.content')}</p>
</div>
);
export default translate('common')(Home);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment