Gatsby: [gatsby-plugin-react-next] React 16.3 or 16.2

Created on 2 Apr 2018  路  4Comments  路  Source: gatsbyjs/gatsby

Hello, would it be possible to upgrade the plugin https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-plugin-react-next

to support React 16.3 or at least 16.2 ?

Most helpful comment

I don't use this plugin, but I've just installed latest react and react-dom and after that usually "import React from 'react'" in my project. React.version shows 16.3
@KyleAMathews, is it correct way? I have no troubles with this.

P. S. As a proof, React.Fragment works.

All 4 comments

I don't use this plugin, but I've just installed latest react and react-dom and after that usually "import React from 'react'" in my project. React.version shows 16.3
@KyleAMathews, is it correct way? I have no troubles with this.

P. S. As a proof, React.Fragment works.

I had the same problem, first got it to work by installing react and react-dom manually. Then I had this idea that maybe uninstalling and reinstalling gatsby-plugin-react-next would fix this. And it did.

I no longer have react and react-dom packages and it still shows React.version as 16.3.0. Plus the new Context API works :)

When gatsby-plugin-react-next is installed it'll include the newest available version of React 16. To upgrade to a newer version of React, then it sounds like any of the above methods should work.

Indeed! I now checked my version too> 16.3.1 .

Ok my question arised because I wanted to use the new Fragments Syntax introduced with 16.2
<> </>

But now realised, that this wont work with Babel 6 > https://reactjs.org/blog/2017/11/28/react-v16.2.0-fragment-support.html#babel

Was this page helpful?
0 / 5 - 0 ratings

Related issues

timbrandin picture timbrandin  路  3Comments

benstr picture benstr  路  3Comments

ghost picture ghost  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

theduke picture theduke  路  3Comments