As of React 16.2 JSX fragments can use a <></> syntax instead of <Fragment></Fragment>. The latter syntax is supported in Gatsby, but the former is unsupported yet because it involves updating babel-preset-react.
Yeah, this will come along with our upgrade to Babel 7 in v2.
Is this still relevant? I'm having issues implementing the React.Fragment shorthand in v2.
Any updates on this ?
I cannot use React.Fragment
It gives me this error
React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in.
Check your code at file.js:6.
Hey!
Shortcut for fragment works fine.
Most helpful comment
Yeah, this will come along with our upgrade to Babel 7 in v2.