Skip to content

Invariant Violation when rendering using both ReactDOM and ReactDOMServer #8487

@martinkadlec0

Description

@martinkadlec0

Using both ReactDOM.render and ReactDOMServer.render(\w+) causes an invariant violation in React 15.4.1.

See console on https://jsfiddle.net/martinkadlec/jb7bqg5o/4/
There is:

react-dom.js:18121 Warning: Exception thrown by hook while handling onSetChildren: Invariant Violation: Item must have been set
Invariant Violation: Item must have been set
    at invariant (https://unpkg.com/react@15.4.1/dist/react-with-addons.js:5175:15)

Notice that I render completely different components with each of the render methods.

Some criteria have to be met for the warning to show, like at least two nested components.

To me it seems like the ReactDOMServer is messing with itemMap in the regular React and the IDs of components doesn't match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions