mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add Use React 16 With Gatsby as a react til
This commit is contained in:
@@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
||||
For a steady stream of TILs from a variety of rocketeers, checkout
|
||||
[til.hashrocket.com](https://til.hashrocket.com/).
|
||||
|
||||
_675 TILs and counting..._
|
||||
_676 TILs and counting..._
|
||||
|
||||
---
|
||||
|
||||
@@ -483,6 +483,7 @@ _675 TILs and counting..._
|
||||
- [Test Files In create-react-app](react/test-files-in-create-react-app.md)
|
||||
- [Upgrading To The Latest React In CodeSandbox](react/upgrading-to-the-latest-react-in-codesandbox.md)
|
||||
- [Use A Ref To Autofocus An Input](react/use-a-ref-to-autofocus-an-input.md)
|
||||
- [Use React 16 With Gatsby](react/use-react-16-with-gatsby.md)
|
||||
- [Use withRouter To Pass Down React-Router History](react/use-withrouter-to-pass-down-react-router-history.md)
|
||||
- [Visually Select A React Element For Inspection](react/visually-select-a-react-element-for-inspection.md)
|
||||
- [Who Is Your Favorite Child?](react/who-is-your-favorite-child.md)
|
||||
|
||||
23
react/use-react-16-with-gatsby.md
Normal file
23
react/use-react-16-with-gatsby.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Use React 16 With Gatsby
|
||||
|
||||
[Gatsby](https://www.gatsbyjs.org/), the blazing fast static site generator
|
||||
for React, is tied to React 15.6. If you've been using React 16+ for a
|
||||
while, then this may come as a bit of a buzzkill.
|
||||
|
||||
Fortunately, there is a Gatsby plugin that let's you use React 16 with a
|
||||
Gatsby v1 site --
|
||||
[gatsby-plugin-react-next](https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-react-next).
|
||||
|
||||
Add it the plugin as a dependency:
|
||||
|
||||
```bash
|
||||
$ yarn add gatsby-plugin-react-next
|
||||
```
|
||||
|
||||
Then add it to the list of plugins in `gatsby-config.js`:
|
||||
|
||||
```javascript
|
||||
plugins: [`gatsby-plugin-react-next`];
|
||||
```
|
||||
|
||||
[source](https://twitter.com/gatsbyjs/status/990806495959826432)
|
||||
Reference in New Issue
Block a user