Skip to content

Commit f5cf05c

Browse files
committed
fix(preview, text): Improper use of forward ref
1 parent e61bf3d commit f5cf05c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/preview/src/preview.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export const Preview = React.forwardRef<
1616
text = text.substr(0, PREVIEW_MAX_LENGTH);
1717
return (
1818
<div
19-
ref={ref}
2019
style={{
2120
display: "none",
2221
overflow: "hidden",
@@ -26,6 +25,7 @@ export const Preview = React.forwardRef<
2625
maxWidth: 0,
2726
}}
2827
{...props}
28+
ref={ref}
2929
>
3030
{text}
3131
{renderWhiteSpace(text)}

packages/text/src/text.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ export type TextProps = RootProps;
77
export const Text = React.forwardRef<
88
React.ElementRef<"p">,
99
Readonly<TextProps>
10-
>(({ style, ...props }) => (
10+
>(({ style, ...props }, ref) => (
1111
<p
1212
{...props}
13+
ref={ref}
1314
style={{
1415
fontSize: "14px",
1516
lineHeight: "24px",

0 commit comments

Comments
 (0)