Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
rtritto committed Mar 20, 2023
1 parent ae8ba45 commit acf174b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/hooks/useInspect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function useInspect (
const inspect = isTrap
? false
: depth < defaultInspectDepth
setInspectCache({ path, inspect })
setInspectCache({ path, action: inspect })
}
}, [defaultInspectDepth, depth, isTrap, nestedIndex, path, inspectCache, setInspectCache])
const [inspect, set] = useState<boolean>(() => {
Expand All @@ -53,7 +53,7 @@ export function useInspect (
const setInspect = useCallback<Dispatch<SetStateAction<boolean>>>((apply) => {
set((oldState) => {
const newState = typeof apply === 'boolean' ? apply : apply(oldState)
setInspectCache({ path, newState, nestedIndex })
setInspectCache({ path, action: newState, nestedIndex })
return newState
})
}, [nestedIndex, path, setInspectCache])
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import {
createTheme, Paper,
ThemeProvider
} from '@mui/material'
import { useAtomValue, useSetAtom } from 'jotai'
import type { Atom } from 'jotai'
import { useAtom, useSetAtom } from 'jotai'
import type { FC, ReactElement } from 'react'
import { useCallback, useEffect, useMemo, useRef } from 'react'

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

const value = useAtom(valueAtom)
const value = useAtomValue(valueAtom)
const setHover = useSetAtom(setHoverAtom)
return (
<Paper
Expand Down

0 comments on commit acf174b

Please sign in to comment.