Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doesn't play nice with React 19 RC #265

Open
AnthonyPaulO opened this issue Jul 8, 2024 · 0 comments
Open

Doesn't play nice with React 19 RC #265

AnthonyPaulO opened this issue Jul 8, 2024 · 0 comments

Comments

@AnthonyPaulO
Copy link

AnthonyPaulO commented Jul 8, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant