Primer React v36 Release #3889
joshblack
announced in
Announcements
Replies: 1 comment 1 reply
-
is it possible that |
Beta Was this translation helpful? Give feedback.
1 reply
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 v36, you'll see changes to
@primer/react
that make it even easier to build consistent, accessible experiences that feel right at home at GitHub.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 moved from
@primer/react/drafts
to@primer/react
:TreeView
NavList
SegmentedControl
SplitPageLayout
Breaking changes⚠️
The v36 release of
@primer/react
introduces several breaking changes to components and changes to the package itself. To understand how to migrate between v35 and v36 of@primer/react
, review the sections below to understand how your project may be impacted by these changes.Components
The following list of components have breaking changes to their API or availability in
@primer/react
. For a list of deprecated components that have been removed, visit the Removed components section below.AvatarToken
Button
Checkbox
FilterList
FilterSearch
FormControl
Radio
Textarea
TextInputWithTokens
UnderlineNav
AvatarToken
The
size
prop forAvatarToken
has been updated in v36 to only accept"large"
and"xlarge"
.Button
The API for the
Button
component has been updated to match the specification for this component and align with other implementations like in Primer View Components.The
leadingIcon
prop has been renamed toleadingVisual
The
trailingIcon
prop has been renamed totrailingVisual
The
Button.Counter
component has been removed, use thecount
prop insteadThe
outline
variant has been removed, instead usevariant="invisible"
Checkbox
The
validationStatus
prop has been updated and no longer supports the'warning'
value. Instead, only'error'
and'success'
are supported.FilterList
The
FilterList
component has been deprecated in v36 in favor of theActionList
component. To continue using this component, update your imports forFilterList
to import from thedeprecated
entrypoint.FilterSearch
The
FilterSearch
component has been deprecated in v36. A new filter component is currently in progress but is not yet available. Until a new component is ready, use a combination ofButton
,TextInput
, andActionList
to reproduce this component. To continue using this component, update your imports forFilterSearch
to import from thedeprecated
entrypoint.FormControl
The
variant
prop for theFormControl.Validation
component has been updated to no longer support the'warning'
value. Instead, only'error'
and'success'
are supported.Radio
The
validationStatus
prop has been updated and no longer supports the'warning'
value. Instead, only'error'
and'success'
are supported.Textarea
The
validationStatus
prop has been updated and no longer supports the'warning'
value. Instead, only'error'
and'success'
are supported.TextInputWithTokens
The
size
prop has been updated to no longer accept theextralarge
value. Usexlarge
instead.UnderlineNav
The implementation for
UnderlineNav
has been updated in v36. Certainprops
for UnderlineNav have been removed and theUnderlineNav.Link
component has been replaced byUnderlineNav.Item
.actions
align
full
UnderlineNav.Item
componentselected
aria-current
propTo continue using the implementation for
UnderlineNav
fromv35
, import the component from@primer/react/deprecated
.Removed components
The following deprecated components have been removed from
@primer/react
and are no longer available.BorderBox
<BorderBox>
→<Box borderWidth='1px' borderStyle='solid' borderColor='border.primary' borderRadius={2}>
ChoiceFieldset
CheckboxGroup
orRadioGroup
componentItem
CheckboxGroup
orRadioGroup
componentChoiceInputField
FormControl
componentFlex
Box
component,<Flex>
→<Box display="flex">
Grid
Box
component,<Grid>
→<Box display="grid">
Position
Box
component,<Position>
→<Box>
Absolute
Box
component,<Absolute>
→<Box position="absolute">
Fixed
Box
component,<Fixed>
→<Box position="fixed">
Relative
Box
component,<Relative>
→<Box position="relative">
Sticky
Box
component,<Sticky>
→<Box position="sticky">
Dropdown
ActionMenu
componentFormGroup
FormControl
componentInputField
FormControl
componentLabel
Label
component from the@primer/react
entry pointSelectMenu
ActionMenu
componentActionList
ActionList
component from the@primer/react
entry pointActionMenu
ActionMenu
component from the@primer/react
entry pointDropdownButton
ActionMenu
componentDropdownMenu
ActionMenu
componentButton
Button
component from the@primer/react
entry pointButtonDanger
Button
component withvariant="danger"
ButtonOutline
Button
component withvariant="outline"
ButtonPrimary
Button
component withvariant="primary"
ButtonInvisible
Button
component withvariant="invisible"
ButtonTableList
ActionMenu
componentButtonClose
IconButton
component,<IconButton icon={XIcon} aria-label="Close" />
StyledOcticon
Octicon
componentPackage 📦
Changes to peer dependencies 🏗️
The following peer dependencies have been updated, or added, to require a new minimum version in v36 of
@primer/react
:react
^17.0.0 || ^18.0.0
^18.0.0
react-dom
^17.0.0 || ^18.0.0
^18.0.0
styled-components
4.x || 5.x
5.x
@types/styled-components
5.x
These dependencies will need to be updated or installed in your project if you are not using the corresponding version range for v36. To see if you're using the correct versions, look in your project's
package.json
file and see if the versions match the table above.drafts
has been moved toexperimental
The
drafts
entrypoint has been deprecated in v35 and removed in v36. It has been replaced by theexperimental
entrypoint to better reflect the component lifecycle process for Primer.Beta Was this translation helpful? Give feedback.
All reactions