Skip to content

Commit acf174b

Browse files
committed
Fix typo
1 parent ae8ba45 commit acf174b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/hooks/useInspect.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function useInspect (
3636
const inspect = isTrap
3737
? false
3838
: depth < defaultInspectDepth
39-
setInspectCache({ path, inspect })
39+
setInspectCache({ path, action: inspect })
4040
}
4141
}, [defaultInspectDepth, depth, isTrap, nestedIndex, path, inspectCache, setInspectCache])
4242
const [inspect, set] = useState<boolean>(() => {
@@ -53,7 +53,7 @@ export function useInspect (
5353
const setInspect = useCallback<Dispatch<SetStateAction<boolean>>>((apply) => {
5454
set((oldState) => {
5555
const newState = typeof apply === 'boolean' ? apply : apply(oldState)
56-
setInspectCache({ path, newState, nestedIndex })
56+
setInspectCache({ path, action: newState, nestedIndex })
5757
return newState
5858
})
5959
}, [nestedIndex, path, setInspectCache])

src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import {
22
createTheme, Paper,
33
ThemeProvider
44
} from '@mui/material'
5+
import { useAtomValue, useSetAtom } from 'jotai'
56
import type { Atom } from 'jotai'
6-
import { useAtom, useSetAtom } from 'jotai'
77
import type { FC, ReactElement } from 'react'
88
import { useCallback, useEffect, useMemo, useRef } from 'react'
99

@@ -99,7 +99,7 @@ const JsonViewerInner: FC<JsonViewerProps> = (props) => {
9999
registerTypes(allTypes)
100100
}, [predefinedTypes, props.valueTypes, registerTypes])
101101

102-
const value = useAtom(valueAtom)
102+
const value = useAtomValue(valueAtom)
103103
const setHover = useSetAtom(setHoverAtom)
104104
return (
105105
<Paper

0 commit comments

Comments
 (0)