fix(deps): sync react-dom peer dependency version with react#10195
Merged
GiladShoham merged 1 commit intomasterfrom Feb 12, 2026
Merged
fix(deps): sync react-dom peer dependency version with react#10195GiladShoham merged 1 commit intomasterfrom
GiladShoham merged 1 commit intomasterfrom
Conversation
…nt workspace mismatches
zkochan
approved these changes
Feb 12, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Ensures workspace installs don’t end up with an incompatible react-dom when an env defines both react and react-dom as peers but a component only directly imports react.
Changes:
- When a component uses
reactas an env-provided peer, also injectreact-dom(from the env’s default peer versions) into the component’s install manifest to keep versions aligned.
Comment on lines
+222
to
+231
| // In case the env has peer dependencies on both react and react-dom, we want to make sure to keep the versions | ||
| // in sync with each other, otherwise it may cause issues in the workspace | ||
| // This is a special case for react and react-dom, as most component do import from react, making it a peer dependency, | ||
| // but not necessarily import from react-dom, which from env.jsonc peers in that case not added to the peers of the component. | ||
| // and if the versions are not in sync, it may cause issues in the workspace | ||
| // an example: | ||
| // my-comp depend on react, and using @testing-library/react which depend on react-dom (as peer), | ||
| // the component don't have react-dom as peer dependency, but when we install the dependencies in the workspace, | ||
| // it will install the latest version of react-dom which may not be compatible with the version of react that my-comp | ||
| // is using, and it may cause issues in the workspace. |
There was a problem hiding this comment.
This block comment is very long and repeats the same point several times, which makes the surrounding logic harder to read. Consider shortening it to a brief rationale + a compact example, and fix the grammar (e.g., “most components import”, “depends”, “doesn’t”).
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.
When the env has both react and react-dom as peer dependencies, but a component only imports react (not react-dom), the workspace install could pull an incompatible react-dom version. This ensures react-dom version stays in sync with react from the env's default peers.