Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(H): deprecate is and style_type properties #1856

Merged
merged 1 commit into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,6 @@ exports[`GlobalError snapshot have to match component snapshot 1`] = `
className={null}
level={null}
size="xx-large"
style_type={null}
top="4"
>
<ForwardRef
Expand Down
10 changes: 0 additions & 10 deletions packages/dnb-eufemia/src/elements/H.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ export default class H extends React.PureComponent {
className: PropTypes.string,
as: PropTypes.string,

/** @deprecated use as instead */
is: PropTypes.string,

level: PropTypes.string,
size: PropTypes.oneOf([
'xx-large',
Expand All @@ -30,15 +27,13 @@ export default class H extends React.PureComponent {
'small',
'x-small',
]),
style_type: PropTypes.string, // deprecated
children: PropTypes.node,
}
static defaultProps = {
className: null,
level: null,
as: 'h1',
size: 'xx-large',
style_type: null, // deprecated
children: null,
}

Expand All @@ -54,16 +49,11 @@ export default class H extends React.PureComponent {
as,
is,
level, // eslint-disable-line
style_type,
size,
className,
...props
} = this.props

if (style_type) {
size = style_type // deprecated
}

return (
<E
as={as || is}
Expand Down