children: any -> children: ReactNode (#3061)

We use `children: any` in a bunch of places, but the proper type for
these is `ReactNode`. This diff fixes those.

### Change Type

- [x] `patch` — Bug fix
This commit is contained in:
alex 2024-03-04 14:48:40 +00:00 committed by GitHub
parent 18a550ccdb
commit 15c760f7ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 505 additions and 188 deletions

View file

@ -1,7 +1,8 @@
'use client'
import { ThemeProvider } from 'next-themes'
import { ReactNode } from 'react'
export function Providers({ children }: { children: any }) {
export function Providers({ children }: { children: ReactNode }) {
return <ThemeProvider enableSystem>{children}</ThemeProvider>
}

View file

@ -1,9 +1,9 @@
'use client'
import { useRouter } from 'next/navigation'
import { useEffect } from 'react'
import { ReactNode, useEffect } from 'react'
let AutoRefresh = ({ children }: { children: any }) => {
let AutoRefresh = ({ children }: { children: ReactNode }) => {
return children
}

View file

@ -1,4 +1,4 @@
import { useEffect, useState, version } from 'react'
import { ReactNode, useEffect, useState, version } from 'react'
import { LoadingScreen } from 'tldraw'
import { useUrl } from '../hooks/useUrl'
import { trackAnalyticsEvent } from '../utils/trackAnalyticsEvent'
@ -47,7 +47,7 @@ export function IFrameProtector({
| 'history-snapshot'
| 'history'
| 'local'
children: any
children: ReactNode
}) {
const [embeddedState, setEmbeddedState] = useState<
'iframe-unknown' | 'iframe-not-allowed' | 'not-iframe' | 'iframe-ok'