rsnext/examples/with-react-intl/components/Nav.tsx
Long Ho 5a478b4eef
feat: upgrade react-intl workflow in example (#16215)
Changes:
- Migrate to TypeScript. `react-intl` natively supports TypeScript now.
- Upgrade corresponding `formatjs` packages.
- Dynamically polyfill Intl API per locale since those polyfills are huge.
- Migrate to recommended workflow per https://formatjs.io/docs/getting-started/application-workflow
2020-08-27 22:59:33 +00:00

34 lines
647 B
TypeScript

import * as React from 'react';
import {FormattedMessage} from 'react-intl';
import Link from 'next/link';
export default function Nav() {
return (
<nav>
<li>
<Link href="/">
<a>
<FormattedMessage defaultMessage="Home" />
</a>
</Link>
</li>
<li>
<Link href="/about">
<a>
<FormattedMessage defaultMessage="About" />
</a>
</Link>
</li>
<style jsx>{`
nav {
display: flex;
}
li {
list-style: none;
margin-right: 1rem;
}
`}</style>
</nav>
);
}