You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue is related to react changing the Symbol.for('react.element') to Symbol.for('react.transitional.element') - see facebook/react@3b551c8
This is a bit tricky for Jest as updating the react-is library to v19 will break react <19 and keeping the current version breaks the new react. I am having very similar issue in my library for shallow rendering react components and my current solution is adding react-is as a peer dependency and having users specify the react-is version as a dependency in their projects, but it is not very practical especially in a library like Jest.
Maybe updating react-is to v19 (in pretty-format) and changing this condition with
typeofval==='object'&&val!=null&&(ReactIs.isElement(val)||val.$$typeof===Symbol.for('react.element')// Compatibility with react <19)
will solve the issue? But I am not sure if there are more use-cases, that can break.
Version
29.7.0
Steps to reproduce
Clone repo:
git clone https://github.com/remarkablemark/html-react-parser.git cd html-react-parser git checkout build/package
Install deps:
Run tests:
npm test
See remarkablemark/html-react-parser#1629 (comment)
Expected behavior
Snapshot tests without issues
Actual behavior
Snapshot tests failing for React 19:
Additional context
No response
Environment
The text was updated successfully, but these errors were encountered: