chore(live-preview-react): enable TypeScript strict (#12298)

This commit is contained in:
Germán Jabloñski
2025-05-02 17:10:40 -03:00
committed by GitHub
parent b480f81387
commit 11018ebfe0
2 changed files with 2 additions and 7 deletions

View File

@@ -7,7 +7,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'
// To prevent the flicker of stale data while the post message is being sent,
// you can conditionally render loading UI based on the `isLoading` state
export const useLivePreview = <T extends any>(props: {
export const useLivePreview = <T extends Record<string, unknown>>(props: {
apiRoute?: string
depth?: number
initialData: T
@@ -21,7 +21,7 @@ export const useLivePreview = <T extends any>(props: {
const [isLoading, setIsLoading] = useState<boolean>(true)
const hasSentReadyMessage = useRef<boolean>(false)
const onChange = useCallback((mergedData) => {
const onChange = useCallback((mergedData: T) => {
setData(mergedData)
setIsLoading(false)
}, [])

View File

@@ -1,9 +1,4 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
/* TODO: remove the following lines */
"strict": false,
"noUncheckedIndexedAccess": false,
},
"references": [{ "path": "../payload" }]
}