Skip to content

Commit 11018eb

Browse files
authored
chore(live-preview-react): enable TypeScript strict (#12298)
1 parent b480f81 commit 11018eb

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

packages/live-preview-react/src/useLivePreview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { useCallback, useEffect, useRef, useState } from 'react'
77
// To prevent the flicker of stale data while the post message is being sent,
88
// you can conditionally render loading UI based on the `isLoading` state
99

10-
export const useLivePreview = <T extends any>(props: {
10+
export const useLivePreview = <T extends Record<string, unknown>>(props: {
1111
apiRoute?: string
1212
depth?: number
1313
initialData: T
@@ -21,7 +21,7 @@ export const useLivePreview = <T extends any>(props: {
2121
const [isLoading, setIsLoading] = useState<boolean>(true)
2222
const hasSentReadyMessage = useRef<boolean>(false)
2323

24-
const onChange = useCallback((mergedData) => {
24+
const onChange = useCallback((mergedData: T) => {
2525
setData(mergedData)
2626
setIsLoading(false)
2727
}, [])
Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
{
22
"extends": "../../tsconfig.base.json",
3-
"compilerOptions": {
4-
/* TODO: remove the following lines */
5-
"strict": false,
6-
"noUncheckedIndexedAccess": false,
7-
},
83
"references": [{ "path": "../payload" }]
94
}

0 commit comments

Comments
 (0)