Skip to content

Commit

Permalink
fix(preview, text): Improper use of forward ref
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielmfern committed Jul 1, 2024
1 parent c082863 commit 8a41d44
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/preview/src/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const Preview = React.forwardRef<
text = text.substr(0, PREVIEW_MAX_LENGTH);
return (
<div
ref={ref}
style={{
display: "none",
overflow: "hidden",
Expand All @@ -26,6 +25,7 @@ export const Preview = React.forwardRef<
maxWidth: 0,
}}
{...props}
ref={ref}
>
{text}
{renderWhiteSpace(text)}
Expand Down
3 changes: 2 additions & 1 deletion packages/text/src/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ export type TextProps = RootProps;
export const Text = React.forwardRef<
React.ElementRef<"p">,
Readonly<TextProps>
>(({ style, ...props }) => (
>(({ style, ...props }, ref) => (
<p
{...props}
ref={ref}
style={{
fontSize: "14px",
lineHeight: "24px",
Expand Down

0 comments on commit 8a41d44

Please sign in to comment.