Skip to content
This repository was archived by the owner on Dec 1, 2019. It is now read-only.
This repository was archived by the owner on Dec 1, 2019. It is now read-only.

React.Fragment works but the short syntax (<>...</>) doesn't #542

Closed
@devuxer

Description

@devuxer

In my .tsx file, I'm able to use React.Fragment:

return (
    <React.Fragment>
        <p>Your registration has been validated.</p>
        <p>You will be notified by email once an administrator has approved your registration.</p>
    </React.Fragment>
);

But I'm not able to use the short syntax:

return (
    <>
        <p>Your registration has been validated.</p>
        <p>You will be notified by email once an administrator has approved your registration.</p>
    </>
);

The short syntax results in:

ERROR in [at-loader] ./src/client/account/components/info-panel/InfoPanel.tsx:10:5
TS1109: Expression expected.
ERROR in [at-loader] ./src/client/account/components/info-panel/InfoPanel.tsx:10:6
TS1109: Expression expected.
ERROR in [at-loader] ./src/client/account/components/info-panel/InfoPanel.tsx:13:5
TS2657: JSX expressions must have one parent element.
ERROR in [at-loader] ./src/client/account/components/info-panel/InfoPanel.tsx:13:7
TS1109: Expression expected.
ERROR in [at-loader] ./src/client/account/components/info-panel/InfoPanel.tsx:14:1
TS1109: Expression expected.
ERROR in [at-loader] ./src/client/account/components/info-panel/InfoPanel.tsx:10:5
TS2365: Operator '>' cannot be applied to types 'boolean' and 'Element'.
ERROR in [at-loader] ./src/client/account/components/info-panel/InfoPanel.tsx:11:9
TS2695: Left side of comma operator is unused and has no side effects.
ERROR in [at-loader] ./src/client/account/components/info-panel/InfoPanel.tsx:13:7
TS7027: Unreachable code detected.

Are there plans to support the short syntax for JSX/TSX fragments?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions