From 31c71f1b58f428b67610424f4cb5572429855d58 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Mon, 30 Apr 2018 17:16:33 -0500 Subject: [PATCH] Add Use React 16 With Gatsby as a react til --- README.md | 3 ++- react/use-react-16-with-gatsby.md | 23 +++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 react/use-react-16-with-gatsby.md diff --git a/README.md b/README.md index 8296c7d..76f616d 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/react/use-react-16-with-gatsby.md b/react/use-react-16-with-gatsby.md new file mode 100644 index 0000000..d138438 --- /dev/null +++ b/react/use-react-16-with-gatsby.md @@ -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)