Skip to content

@emotion/core doesn't handle React.Fragment shorthand correctly. #1549

Closed
@shakib609

Description

Current behavior:
Throws an error "React is not defined".
If React is imported then throws a warning "'React' is defined but never used."

To reproduce:

  1. Create an app with create-react-app
  2. Create a component which uses jsx instead of React.
  3. Use React.Fragment shorthand as the container of that component.
  4. Import the component and render it.

CodeSandbox: https://codesandbox.io/s/pensive-edison-bdkpp

Expected behavior:
It would be great if emotion could handle the shorthand out of the box. If not, it should not at least warn me about React not being used.

Environment information:

  • react version: 16.10.2
  • @emotion/core version: 10.0.21

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions