fix(preview-server): skip data-source-* props on Fragment elements#3059
Open
mvanhorn wants to merge 1 commit intoresend:canaryfrom
Open
fix(preview-server): skip data-source-* props on Fragment elements#3059mvanhorn wants to merge 1 commit intoresend:canaryfrom
mvanhorn wants to merge 1 commit intoresend:canaryfrom
Conversation
Fragments only accept `key` and `children` props. Adding `data-source-file` and `data-source-line` to Fragments triggers React 18 warnings. Fixes resend#2943 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@mvanhorn is attempting to deploy a commit to the resend Team on Vercel. A member of the Team first needs to authorize it. |
|
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The custom
jsxDEVwrapper in@react-email/preview-serverunconditionally addsdata-source-fileanddata-source-lineprops to all JSX elements, includingReact.Fragment. Since Fragments only acceptkeyandchildrenprops, this triggers a React 18 warning:This PR adds a
type !== Fragmentguard so data-source props are only added to non-Fragment elements.Fixes #2943
Changes
packages/preview-server/jsx-runtime/jsx-dev-runtime.js: Addedtype !== Fragmentcondition to the source reference guardThis contribution was developed with AI assistance (Claude Code).
Summary by cubic
Skip adding
data-source-fileanddata-source-lineprops toReact.Fragmentin the@react-email/preview-serverjsxDEVwrapper. This removes React 18 invalid prop warnings by only adding source props to non-Fragment elements.Written for commit f29a11c. Summary will update on new commits.