1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00
next.js/examples/with-react-i18next/pages/index.js
Jan Mühlemann e11d08ae45 Update with react 18next to latest (#5017)
* update with-react-i18next supporting new _app.js

* update readme to not encourage cloning of repo
2018-08-24 09:49:10 +02:00

35 lines
874 B
JavaScript

import React from 'react'
import Link from 'next/link'
import PureComponent from '../components/PureComponent'
import ExtendedComponent from '../components/ExtendedComponent'
import ComponentWithTrans from '../components/ComponentWithTrans'
import { withI18next } from '../lib/withI18next'
const TestContent = withI18next(['home', 'common'])(({ t, initialI18nStore }) => (
<div>
<h1>{t('welcome')}</h1>
<p>{t('common:integrates_react-i18next')}</p>
<p>{t('sample_test')}</p>
<div>
<button>{t('sample_button')}</button>
</div>
<PureComponent t={t} />
<ExtendedComponent />
<ComponentWithTrans />
<Link href='/page2'>
<a>{t('link.gotoPage2')}</a>
</Link>
<br />
<Link href='/page3'>
<a>{t('link.gotoPage3')}</a>
</Link>
</div>
))
const Test = () => {
return <TestContent />
}
export default Test