Skip to content

fix: validate children inside JSX fragments#23

Merged
HorusGoul merged 1 commit into
mainfrom
fix/fragment-children-validation
Feb 4, 2026
Merged

fix: validate children inside JSX fragments#23
HorusGoul merged 1 commit into
mainfrom
fix/fragment-children-validation

Conversation

@HorusGoul

Copy link
Copy Markdown
Owner

Summary

  • Fix bug where JSX fragments (<>...</>) in children were silently skipped during @renders validation
  • Components inside fragments — nested or otherwise — were never checked against annotations
  • Recursively unwrap fragments in validateJSXChildren (valid-render-prop.ts) and extractChildElementNames (jsx-extraction.ts)

Test plan

  • Added valid test: nested fragments + React.Suspense transparent with correct Tab children
  • Added invalid test: same structure with a Footer alongside a valid Tab — only Footer errors
  • All 420 existing tests pass

Fragments in JSX children were silently skipped during validation,
meaning components inside fragments were never checked against
@renders annotations. Recursively unwrap fragments in both
validateJSXChildren and extractChildElementNames.
@HorusGoul HorusGoul marked this pull request as ready for review February 4, 2026 23:31
@HorusGoul HorusGoul merged commit 0e34974 into main Feb 4, 2026
1 check passed
@HorusGoul HorusGoul deleted the fix/fragment-children-validation branch February 4, 2026 23:31
@github-actions github-actions Bot mentioned this pull request Feb 4, 2026
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

Successfully merging this pull request may close these issues.

1 participant