From 5f3c6571e2e4fc76ab2cb1e7a9db42db91ce8e69 Mon Sep 17 00:00:00 2001 From: Max Holman Date: Mon, 16 Jan 2023 21:14:07 +0800 Subject: [PATCH] fix: forwardref on `Block` --- lib/layout.tsx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/layout.tsx b/lib/layout.tsx index 7b2b50a..9107d79 100644 --- a/lib/layout.tsx +++ b/lib/layout.tsx @@ -19,19 +19,20 @@ export type BlockProps = Merge< } >; -export const Block = ({ - component = 'div', - space = 'large', - className, - ...props -}: BlockProps) => ( +const BlockInner = ( + { space = 'large', className, component = 'div', ...props }: BlockProps, + ref: ForwardedRef, +): ReactElement | null => ( ); +export const Block = forwardRef(BlockInner); + export type InlineProps = Merge< BoxBasedComponentProps, {