From 40fd467f228fdf706886d394bb767916f036784b Mon Sep 17 00:00:00 2001 From: Forrest Wolf Date: Wed, 25 May 2022 11:22:12 -0400 Subject: [PATCH] Give react children explicit types --- web/components/advanced-panel.tsx | 4 ++-- web/components/confirmation-button.tsx | 4 ++-- web/components/join-spans.tsx | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/web/components/advanced-panel.tsx b/web/components/advanced-panel.tsx index 1a8cf389..51caba67 100644 --- a/web/components/advanced-panel.tsx +++ b/web/components/advanced-panel.tsx @@ -1,7 +1,7 @@ import clsx from 'clsx' -import { useState } from 'react' +import { useState, ReactNode } from 'react' -export function AdvancedPanel(props: { children: any }) { +export function AdvancedPanel(props: { children: ReactNode }) { const { children } = props const [collapsed, setCollapsed] = useState(true) diff --git a/web/components/confirmation-button.tsx b/web/components/confirmation-button.tsx index c23ec87c..e07b6dab 100644 --- a/web/components/confirmation-button.tsx +++ b/web/components/confirmation-button.tsx @@ -1,5 +1,5 @@ import clsx from 'clsx' -import { useState } from 'react' +import { ReactNode, useState } from 'react' import { Col } from './layout/col' import { Modal } from './layout/modal' import { Row } from './layout/row' @@ -20,7 +20,7 @@ export function ConfirmationButton(props: { className?: string } onSubmit: () => void - children: any + children: ReactNode }) { const { id, openModalBtn, cancelBtn, submitBtn, onSubmit, children } = props diff --git a/web/components/join-spans.tsx b/web/components/join-spans.tsx index e6947ee8..d2ab9d03 100644 --- a/web/components/join-spans.tsx +++ b/web/components/join-spans.tsx @@ -1,5 +1,7 @@ +import { ReactChild } from 'react' + export const JoinSpans = (props: { - children: any[] + children: ReactChild[] separator?: JSX.Element | string }) => { const { separator } = props