Skip to content

Commit

Permalink
Fix(web-react): Unwanted Heading elementType prop on a DOM element #D…
Browse files Browse the repository at this point in the history
…S-1553
  • Loading branch information
curdaj committed Nov 12, 2024
1 parent df768e8 commit 68268e8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/web-react/src/components/Heading/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const defaultProps: Partial<SpiritHeadingProps<ElementType, void, void>> = {
const Heading = <T extends ElementType, S = void, E = void>(props: SpiritHeadingProps<T, S, E>): JSX.Element => {
const propsWithDefaults = { ...defaultProps, ...props };
const { elementType: ElementTag, children, ...restProps } = propsWithDefaults;
const { classProps, props: modifiedProps } = useHeadingStyleProps({ ...restProps, elementType: ElementTag });
const { classProps, props: modifiedProps } = useHeadingStyleProps({ ...restProps });
const { styleProps, props: otherProps } = useStyleProps(modifiedProps);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ export interface HeadingStyles<T extends ElementType> {
/** className props */
classProps: string | null;
/** props to be passed to the input element */
props: HeadingProps<T>;
props: Omit<HeadingProps<T>, 'elementType'>;
}

export function useHeadingStyleProps<T extends ElementType, S = void, E = void>(
props: SpiritHeadingProps<T, S, E>,
props: Omit<SpiritHeadingProps<T, S, E>, 'elementType'>,
): HeadingStyles<T> {
const { size, emphasis, ...restProps } = props;

Expand Down

0 comments on commit 68268e8

Please sign in to comment.