Skip to content

Doesn't play nice with React 19 RC #265

@AnthonyPaulO

Description

@AnthonyPaulO

In "node_modules/deepmerge/dist/cjs.js" there's a line of code:

var REACT_ELEMENT_TYPE = canUseSymbol ? Symbol.for("react.element") : 60103;

React 19 uses "react.transitional.element" as its REACT_ELEMENT_TYPE, so operations that attempt to check if an object is a react element fails, such as the ReactChildren function "mapIntoArray" which does the following comparison in its switch statement:

`

          case "object":
            switch (children.$$typeof) {
              case REACT_ELEMENT_TYPE:
              case REACT_PORTAL_TYPE:
                invokeCallback = true;
            }

`

Since children.$$typeof is 'react.transitional.element', and deepmerge has its own definition of REACT_ELEMENT_TYPE being "react.element", this fails the check and the function mapIntoArray fails.

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