Skip to content

"Multiple root nodes returned from render function" error with functional component #8837

@lebesnec

Description

@lebesnec

Version

2.5.17

Reproduction link

https://jsfiddle.net/9mnqs3g2/

Steps to reproduce

open the reproduction link and look at the JS console.

What is expected?

You can have multiple root elements in functional components.

What is actually happening?

"Multiple root nodes returned from render function. Render function should return a single root node." error in console, nothing render.


According to #7088 (comment) functional component are the way to go if you need more than one root element.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions