Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for React 16 Fragment syntax #1029

Closed
limbosounds opened this issue Mar 1, 2018 · 6 comments
Closed

Support for React 16 Fragment syntax #1029

limbosounds opened this issue Mar 1, 2018 · 6 comments

Comments

@limbosounds
Copy link

  • What version of documentation.js are you using?: 5.4.0
  • How are you running documentation.js (on the CLI, Node.js API, Grunt, other?): CLI

Running (as mentioned in --help)

documentation build src/** -f html -o docs

Getting error in one of my components:

SyntaxError: /home/limbo/<some_path>/SomeComponent.jsx: Unexpected token (15:4)
  14 |          return (
> 15 |                  <>
     |                   ^
  16 |                          {[...Array(count < 1 ? 1 : count)].map((_, i) => {
  17 |                                  return (
  18 |                                          <React.Fragment key={i}>

Do I make something wrong, or there is no React 16 Fragment syntax support yet?
Thank you in advance!

@arv
Copy link
Contributor

arv commented Mar 1, 2018

We need to update our Babel dependencies. Would you have time to create a PR? Thanks.

@limbosounds
Copy link
Author

@arv I'll try, maybe on Saturday 😅

@limbosounds
Copy link
Author

@arv well, I tried, but fragment syntax requires babel 7 and I aware of make something wrong. I'm sorry, but I'm newbee in configuration 😞

@arv
Copy link
Contributor

arv commented Mar 5, 2018

Understood. I think we should at least wait until Babel 7 is no longer in beta 😿

@tomscholz
Copy link

I disagree, I am using the beta in most of my projects already in production and the meteor.js framework for example is using the beta aswell and it's just working fine :)

Other projects, such as React, have already begun to recommend Babel plugins that depend on Babel 7, such as @babel/plugin-transform-react-jsx: https://reactjs.org/blog/2017/11/28/react-v16.2.0-fragment-support.html#babel (Source)

@tmcw
Copy link
Member

tmcw commented Apr 11, 2018

Merging into #996 - appreciate any help managing the Babel 7 update.

@tmcw tmcw closed this as completed Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants