Update Primer React to v38 - #72
Merged
Merged
Conversation
danielguillan
temporarily deployed
to
github-pages
November 24, 2025 21:31 — with
GitHub Actions
Inactive
Contributor
There was a problem hiding this comment.
Pull request overview
This PR upgrades @primer/react from v37 to v38 across all packages in the monorepo, migrating away from Primer React's deprecated Box component and sx prop pattern in favor of CSS Modules and inline styles with CSS custom properties.
Key Changes:
- Upgraded
@primer/reactto v38.0.0 in package.json files (theme, site, root) - Refactored components to remove
Boxusage and replace with native HTML elements (div,span) - Migrated from
sxprop to CSS Modules and inline styles using CSS custom properties - Updated tests to remove dependency on Primer theme providers where no longer needed
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/theme/package.json | Upgrades @primer/react dependency to v38.0.0 |
| packages/theme/components/layout/sidebar/Sidebar.tsx | Replaces sx prop with inline styles using CSS custom properties for margin spacing |
| packages/theme/components/layout/root-layout/Theme.tsx | Removes Box component usage, replaces with native div elements and inline styles; removes explanatory comments for breadcrumb filtering logic |
| packages/theme/components/layout/root-layout/Theme.module.css | Adds new CSS module with classes that are not currently imported or used in the component |
| packages/theme/components/layout/nav-drawer/Drawer.tsx | Migrates from Box with sx prop to motion.div with CSS module classes |
| packages/theme/components/layout/nav-drawer/Drawer.module.css | Adds CSS module for drawer overlay and panel styling |
| packages/theme/components/content/dos-and-donts/DosAndDonts.tsx | Removes Box component, replaces with native div and inline styles |
| packages/theme/components/content/caption/Caption.tsx | Refactors from Primer's Text component to native span with CSS module |
| packages/theme/components/content/caption/Caption.test.tsx | Updates tests to use standard render instead of renderWithPrimerThemeProviders |
| packages/theme/components/content/caption/Caption.module.css | Adds CSS module for caption styling |
| packages/site/package.json | Upgrades @primer/react dev dependency to v38.0.0 |
| package.json | Upgrades @primer/react dev dependency to v38.0.0 in root |
| package-lock.json | Updates lockfile with new v38 dependencies and peer dependency changes |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
danielguillan
temporarily deployed
to
github-pages
November 24, 2025 21:42 — with
GitHub Actions
Inactive
danielguillan
temporarily deployed
to
github-pages
November 24, 2025 21:52 — with
GitHub Actions
Inactive
rezrah
reviewed
Nov 25, 2025
rezrah
reviewed
Nov 25, 2025
rezrah
approved these changes
Nov 26, 2025
rezrah
left a comment
Collaborator
There was a problem hiding this comment.
Looks good. Only some minor feedback about removal of inline styles, otherwise LGTM 🚢
danielguillan
temporarily deployed
to
github-pages
November 27, 2025 16:37 — with
GitHub Actions
Inactive
danielguillan
temporarily deployed
to
github-pages
November 27, 2025 16:43 — with
GitHub Actions
Inactive
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.
Towards https://github.com/github/primer/issues/6134
List of notable changes:
@primer/reactto version 38 in all relevantpackage.jsonfiles.Boxfrom@primer/react.sxprop in favor of CSS modules and inline styles.No visual changes expected.