File tree Expand file tree Collapse file tree 2 files changed +12
-7
lines changed
packages/react/src/Blankslate Expand file tree Collapse file tree 2 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @primer/react " : patch
3+ ---
4+
5+ fix(Blankslate): Don't use Box to render heading when flag is enabled
Original file line number Diff line number Diff line change @@ -174,15 +174,15 @@ export type HeadingProps = React.PropsWithChildren<{
174174 as ?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'
175175} >
176176
177- function Heading ( { as = 'h2' , children} : HeadingProps ) {
177+ function Heading ( { as : Component = 'h2' , children} : HeadingProps ) {
178178 const enabled = useFeatureFlag ( 'primer_react_css_modules' )
179+
180+ if ( enabled ) {
181+ return < Component className = { cx ( 'Blankslate-Heading' , classes . Heading ) } > { children } </ Component >
182+ }
183+
179184 return (
180- < Box
181- as = { as }
182- className = { cx ( 'Blankslate-Heading' , {
183- [ classes . Heading ] : enabled ,
184- } ) }
185- >
185+ < Box as = { Component } className = { cx ( 'Blankslate-Heading' ) } >
186186 { children }
187187 </ Box >
188188 )
You can’t perform that action at this time.
0 commit comments