From ace26701498726794981129fecd045dc953b04f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabian=20Ka=CC=88gy?= Date: Wed, 20 Nov 2024 14:25:42 +0100 Subject: [PATCH] fix only spread rest props to child components --- components/post-meta/index.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/post-meta/index.tsx b/components/post-meta/index.tsx index 2bd7eea8..2c954b81 100644 --- a/components/post-meta/index.tsx +++ b/components/post-meta/index.tsx @@ -16,7 +16,7 @@ interface MetaStringProps } const MetaString: React.FC = (props) => { - const { metaKey, tagName = 'p' } = props; + const { metaKey, tagName = 'p', ...rest } = props; const [metaValue, setMetaValue] = usePostMetaValue(metaKey); const { isEditable } = usePost(); @@ -29,7 +29,7 @@ const MetaString: React.FC = (props) => { value={metaValue ?? ''} onChange={(value: string) => setMetaValue(value)} tagName={tagName} - {...props} + {...rest} /> ); }; @@ -42,7 +42,7 @@ interface MetaNumberProps { } const MetaNumber: React.FC = (props) => { - const { metaKey } = props; + const { metaKey, ...rest } = props; const [metaValue, setMetaValue] = usePostMetaValue(metaKey); const { isEditable } = usePost(); @@ -51,7 +51,7 @@ const MetaNumber: React.FC = (props) => { value={metaValue} onChange={(value) => setMetaValue(parseInt(value ?? '', 10))} disabled={!isEditable} - {...props} + {...rest} /> ); }; @@ -64,7 +64,7 @@ interface MetaBooleanProps extends Pick { } const MetaBoolean: React.FC = (props) => { - const { metaKey } = props; + const { metaKey, ...rest } = props; const [metaValue, setMetaValue] = usePostMetaValue(metaKey); const { isEditable } = usePost(); @@ -73,7 +73,7 @@ const MetaBoolean: React.FC = (props) => { checked={metaValue} onChange={setMetaValue} disabled={!isEditable} - {...props} + {...rest} /> ); };