Repository navigation
feat(react-utilities): add custom JSX.* types that are compatible with various react major versions - #34733
Merged
Martin Hochel (Hotell) merged 11 commits intoJul 25, 2025
Conversation
JSX.* types that are compatible with various react major versions
📊 Bundle size report✅ No changes found |
|
Pull request demo site: URL |
This was referenced Jul 1, 2025
Martin Hochel (Hotell)
force-pushed
the
v9/jsx-namespace-compat-types
branch
from
July 9, 2025 15:02
686874a to
fc0d5f7
Compare
Dmytro Kirpa (dmytrokirpa)
approved these changes
Jul 10, 2025
Contributor
Author
|
can we get review on this one please ? Oleksandr Fediashov (@layershifter) Robert Penner (@robertpenner) |
Bernardo Sunderhus (bsunderhus)
approved these changes
Jul 21, 2025
…various react major versions
…ias for IntrinsicElement and replace occurences
…Element string union type and use that in all v9
…o avoid invalid react elements across various major versions
…ditional based on react version used to support full type soundness based on react version used
Martin Hochel (Hotell)
force-pushed
the
v9/jsx-namespace-compat-types
branch
from
July 24, 2025 13:08
5122a88 to
139a4f8
Compare
Martin Hochel (Hotell)
enabled auto-merge (squash)
July 25, 2025 12:20
Dmytro Kirpa (dmytrokirpa)
pushed a commit
to dmytrokirpa/fluentui
that referenced
this pull request
Jul 28, 2025
…ith various react major versions (microsoft#34733)
1 task done
Tudor Popa (tudorpopams)
pushed a commit
to tudorpopams/fluentui
that referenced
this pull request
Apr 14, 2026
…ith various react major versions (microsoft#34733)
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.
Previous Behavior
New Behavior
1. Introduces React major versions agnostic
JSX.*namespace types exposed as public api ofreact-utilitieskeyof JSX.IntrinsicElements/keyof React.JSX.IntrinsicElementswithJSXIntrinsicElementKeysJSX.IntrinsicElement[T]/React.JSX.IntrinsicElement[T](index accessor) withJSXIntrinsicElement<Element>JSX.Element/React.JSX.ElementwithJSXElementBefore:
After:
2. replaces
keyof JSX.IntrinsicElementsandJSX.IntrinsicElements['div']with our new types within v9Technical Details
These types are auto-generated on every
react-utilititesbuild - making it always in sync.Example of running
nx run react-utilities:build:@types/reactinstalled within node_modules are fetched.tscchecker to unwrap type value ofkeyof JSX.IntrinsicElementsrc/utils/generated-types.tssrc/utils/types.tsFollow up
JSX.Elementoccurrences with customJSXElementin all v9Related Issue(s)