Skip to content

Commit

Permalink
fix Box ts spread props issue (#20107)
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettbear authored Jul 20, 2023
1 parent 733391a commit 26d7520
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/components/component-library/text/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {

import { Box } from '..';

import type { PolymorphicRef } from '../box';
import type { PolymorphicRef, BoxProps } from '../box';

import { TextProps, TextComponent } from './text.types';

Expand Down Expand Up @@ -63,14 +63,15 @@ export const Text: TextComponent = React.forwardRef(
[`mm-text--overflow-wrap-${overflowWrap}`]: Boolean(overflowWrap),
},
);

return (
<Box
className={classnames(computedClassName)}
as={tag}
dir={textDirection}
ref={ref}
color={TextColor.textDefault}
{...props} // TODO: Need to fix Box types to allow for spreading props
{...(props as BoxProps<C>)}
>
{children}
</Box>
Expand Down

0 comments on commit 26d7520

Please sign in to comment.