Primer React v37 Release #5165
joshblack
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We’re excited to announce the next major release of Primer React! 🥳 Starting in v37, you’ll see changes to how we style components using CSS Modules along with new components available from
@primer/react
.As this change is rolled out, we'd love to hear from you and get feedback on these changes. Let us know in a comment below if you run into any bugs, if a change to a component you were using is unclear, or if you have any other feedback about this release.
New Components ✨
The following components have been promoted from
@primer/react/experimental
to@primer/react
:Breaking Changes⚠️
The biggest change in Primer React in v37 is how we handle styling our components. Beginning in this release, we will begin using CSS Modules and move away from our current usage of
styled-components
. This changed is based off of the Styling with CSS ADR. In a future major release, we intend to completely remove our usage ofstyled-components
in favor of CSS Modules.As a result, when bringing Primer React into your project you will need a bundler setup to be aware of how to handle CSS when imported from a JavaScript context.
Package 📦
The
npm
package for@primer/react
has previously supported importing arbitrary subpaths, for example:Starting in v37, this pattern of wildcard imports is no longer supported. Instead, use one of the following named entrypoints:
@primer/react
@primer/react/experimental
@primer/react/deprecated
@primer/react/test-helpers
This change allows the Primer React library to explicitly define what parts of the library are public and are tested appropriately. If there is a component, hook, type, etc from
@primer/react
that you would like to use but it’s unavailable please reach out! We’re always happy to add new exports to these entrypoints if they’re helpful for you.Deprecated Components
The following components have been deprecated and moved from
@primer/react
to@primer/react/deprecated
:@primer/react
instead@primer/octicons-react
withclassName
instead@primer/react
instead@primer/react
insteadRemoved Components
The following components have been removed from Primer React and are no longer available:
@primer/react
instead@primer/react
instead@primer/react
instead@primer/react
instead@primer/react
instead@primer/react
insteadRemoved Helpers
The following utilities or helpers have been removed from Primer React:
React.useId()
insteadBeta Was this translation helpful? Give feedback.
All reactions