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
{{ message }}
Repository navigation
Test with svg as ReactComponent failed with React 19 #17113
When running a test that renders a component importing an SVG as a ReactComponent (e.g. import { ReactComponent as Logo } from './logo.svg';), the test fails with the following error:
A React Element from an older version of React was rendered. This is not supported. It can happen if:
- Multiple copies of the "react" package is used.
- A library pre-bundled an old copy of "react" or "react/jsx-runtime".
- A compiler tries to "inline" JSX instead of using the runtime.
If I render any other element (not the SVG), the test passes. This only happens when rendering the SVG as a ReactComponent.
Steps to reproduce
Steps to reproduce the behavior:
Create a new CRA app (npx create-react-app my-app --template typescript)
Activity
alfiemartin commentedon Aug 22, 2025
Any update ?
agnieszkaac commentedon Sep 4, 2025
This is an issue for me as well. Did anyone find any solution for this?