Skip to content

Commit 4a2bfa6

Browse files
committed
FIx merge conflict
2 parents d19c82e + e818513 commit 4a2bfa6

File tree

6 files changed

+2830
-2150
lines changed

6 files changed

+2830
-2150
lines changed

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,28 @@ const IndexPage = ({ intl }) => {
8989
}
9090
export default injectIntl(IndexPage)
9191
```
92+
Or you can use the new `useIntl` hook.
93+
```jsx
94+
import React from "react"
95+
import { useIntl, Link, FormattedMessage } from "gatsby-plugin-intl"
96+
97+
const IndexPage = () => {
98+
const intl = useIntl()
99+
return (
100+
<Layout>
101+
<SEO
102+
title={intl.formatMessage({ id: "title" })}
103+
/>
104+
<Link to="/page-2/">
105+
{intl.formatMessage({ id: "go_page2" })}
106+
{/* OR <FormattedMessage id="go_page2" /> */}
107+
</Link>
108+
</Layout>
109+
)
110+
}
111+
export default injectIntl(IndexPage)
112+
```
113+
92114

93115
## How It Works
94116

examples/gatsby-starter-default-intl/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
"version": "0.2.7",
66
"author": "Daewoong Moon <wiziple@gmail.com>",
77
"dependencies": {
8-
"gatsby": "2.13.39",
9-
"gatsby-image": "^2.2.6",
8+
"gatsby": "2.17.1",
9+
"gatsby-image": "^2.2.29",
1010
"gatsby-plugin-intl": "^0.2.8",
11-
"gatsby-plugin-manifest": "^2.2.4",
12-
"gatsby-plugin-offline": "^2.2.4",
13-
"gatsby-plugin-react-helmet": "^3.1.2",
14-
"gatsby-plugin-sharp": "^2.2.9",
15-
"gatsby-source-filesystem": "^2.1.6",
16-
"gatsby-transformer-sharp": "^2.2.4",
11+
"gatsby-plugin-manifest": "^2.2.23",
12+
"gatsby-plugin-offline": "^3.0.16",
13+
"gatsby-plugin-react-helmet": "^3.1.13",
14+
"gatsby-plugin-sharp": "^2.2.32",
15+
"gatsby-source-filesystem": "^2.1.33",
16+
"gatsby-transformer-sharp": "^2.3.0",
1717
"prop-types": "^15.7.2",
18-
"react": "^16.8.6",
19-
"react-dom": "^16.8.6",
18+
"react": "^16.11.0",
19+
"react-dom": "^16.11.0",
2020
"react-helmet": "^5.2.1"
2121
},
2222
"devDependencies": {

0 commit comments

Comments
 (0)