diff options
-rw-r--r-- | src/components/AttachLink/AttachLink.tsx | 2 | ||||
-rw-r--r-- | src/components/FileUpload/FileUpload.tsx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/components/AttachLink/AttachLink.tsx b/src/components/AttachLink/AttachLink.tsx index e73f5c1..742ba65 100644 --- a/src/components/AttachLink/AttachLink.tsx +++ b/src/components/AttachLink/AttachLink.tsx @@ -25,7 +25,7 @@ const AttachLink: React.FC<PropTypes> = ({ callback, children }) => { </Button> ); - const child = children && React.Children.toArray(children)[0]; + const child = children && React.Children.only(children); return ( <> diff --git a/src/components/FileUpload/FileUpload.tsx b/src/components/FileUpload/FileUpload.tsx index 1c05e7f..6a31656 100644 --- a/src/components/FileUpload/FileUpload.tsx +++ b/src/components/FileUpload/FileUpload.tsx @@ -23,7 +23,7 @@ const FileUpload: React.FC<PropTypes> = ({ callback, children }) => { if (inputRef?.current) inputRef.current.click(); }; - const child = children && React.Children.toArray(children)[0]; + const child = children && React.Children.only(children); const defaultButton = ( <Button |