Give react children explicit types

This commit is contained in:
Forrest Wolf 2022-05-25 11:22:12 -04:00
parent 8ff3f8336c
commit 40fd467f22
3 changed files with 7 additions and 5 deletions

View File

@ -1,7 +1,7 @@
import clsx from 'clsx' 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 { children } = props
const [collapsed, setCollapsed] = useState(true) const [collapsed, setCollapsed] = useState(true)

View File

@ -1,5 +1,5 @@
import clsx from 'clsx' import clsx from 'clsx'
import { useState } from 'react' import { ReactNode, useState } from 'react'
import { Col } from './layout/col' import { Col } from './layout/col'
import { Modal } from './layout/modal' import { Modal } from './layout/modal'
import { Row } from './layout/row' import { Row } from './layout/row'
@ -20,7 +20,7 @@ export function ConfirmationButton(props: {
className?: string className?: string
} }
onSubmit: () => void onSubmit: () => void
children: any children: ReactNode
}) { }) {
const { id, openModalBtn, cancelBtn, submitBtn, onSubmit, children } = props const { id, openModalBtn, cancelBtn, submitBtn, onSubmit, children } = props

View File

@ -1,5 +1,7 @@
import { ReactChild } from 'react'
export const JoinSpans = (props: { export const JoinSpans = (props: {
children: any[] children: ReactChild[]
separator?: JSX.Element | string separator?: JSX.Element | string
}) => { }) => {
const { separator } = props const { separator } = props