Skip to content

Commit

Permalink
Support as for Pagehead
Browse files Browse the repository at this point in the history
  • Loading branch information
jonrohan committed Dec 19, 2024
1 parent a1dd96a commit 6967171
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/react/src/Pagehead/Pagehead.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {defaultSxProp} from '../utils/defaultSxProp'
import Box from '../Box'

const Pagehead = ({className, sx: sxProp = defaultSxProp, ...rest}: PageheadProps) => {
if (sxProp !== defaultSxProp) {
if (sxProp !== defaultSxProp || rest.as) {
return <Box sx={sxProp} className={clsx(classes.Pagehead, className)} {...rest} />
}
return <div className={clsx(classes.Pagehead, className)} {...rest} />
Expand All @@ -15,5 +15,8 @@ const Pagehead = ({className, sx: sxProp = defaultSxProp, ...rest}: PageheadProp
/**
* @deprecated
*/
export type PageheadProps = SxProp & React.ComponentPropsWithoutRef<'div'>
export type PageheadProps = SxProp &
React.ComponentPropsWithoutRef<'div'> & {
as?: React.ElementType
}
export default Pagehead

0 comments on commit 6967171

Please sign in to comment.