question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

'Fragment' is not defined

See original GitHub issue

package.json

"babel-core": "^6.26.0",
"babel-preset-react": "^6.24.1",
"eslint": "4.12.1",
"babel-eslint": "^8.0.3",
"react": "^16.2.0",
"react-dom": "^16.2.0",

In code

return (
    <Fragment>
           ... code
    </Fragment>
);

here is the error: Error:(9, 10) ESLint: 'Fragment' is not defined. (react/jsx-no-undef)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
budarincommented, Jan 14, 2018

I use to, but I want to use <> syntax 😃

1reaction
ilyavolodincommented, Dec 2, 2017

The error is reported by the rule in eslint-plugin-react. We do not maintain that plugin. You probably want to file the issue there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

'Fragment' is not defined · Issue #1579 · jsx-eslint ... - GitHub
React.Fragment exists in v16.2, but not Fragment .
Read more >
Flow errors on <React.Fragment> or <></>, but not <Fragment>
When I dig into the react.js lib def referenced in the error it does appear that the error is factually correct - the...
Read more >
Fragments - React
A common pattern in React is for a component to return multiple elements. Fragments let you group a list of children without adding...
Read more >
Line 12:6: 'Fragment' is not defined react/jsx-no-undef Code ...
Answers related to “Line 12:6: 'Fragment' is not defined react/jsx-no-undef” · firebase is not defined no undef · [Design System React] App element...
Read more >
Understanding React fragments - LogRocket Blog
Fragments are syntax that allow us to add multiple elements to a React component without wrapping them in an extra DOM node. ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found