Skip to content

fix(react): transpile SVGR into React 19 compatible component#29543

Merged
jaysoo merged 1 commit intomasterfrom
fix/react-jest-svgr
Jan 7, 2025
Merged

fix(react): transpile SVGR into React 19 compatible component#29543
jaysoo merged 1 commit intomasterfrom
fix/react-jest-svgr

Conversation

@jaysoo
Copy link
Copy Markdown
Member

@jaysoo jaysoo commented Jan 7, 2025

This PR fixes an issue with React 19 and our @nx/react/plugins/jest transform. The current transform uses an unsupported $$typeof symbol, and also uses the deprecated forwardRef API.

The updated transform will use new API for React 19 and older, while maintaining the previous API for React 18 and earlier. The backwards compatibility may be needed if the test is using ref, which requires forwardRef older versions.

Current Behavior

SVGR fails in Jest tests with React 19

Expected Behavior

SVGR works

Related Issue(s)

Fixes #

@jaysoo jaysoo requested a review from a team as a code owner January 7, 2025 21:34
@jaysoo jaysoo requested a review from ndcunningham January 7, 2025 21:34
@vercel
Copy link
Copy Markdown

vercel Bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Updated (UTC)
nx-dev ⬜️ Ignored (Inspect) Jan 7, 2025 9:34pm

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Jan 7, 2025

View your CI Pipeline Execution ↗ for commit 63562d6.

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 28m 21s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 1m View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 1s View ↗
nx-cloud record -- nx format:check --base=3f3c8... ✅ Succeeded 18s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 17s View ↗
nx documentation --no-dte ✅ Succeeded 41s View ↗

☁️ Nx Cloud last updated this comment at 2025-01-07 21:56:36 UTC

@jaysoo jaysoo merged commit 90c0c8e into master Jan 7, 2025
@jaysoo jaysoo deleted the fix/react-jest-svgr branch January 7, 2025 23:26
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants