Skip to content

Commit

Permalink
v0.2.8-canary.3
Browse files Browse the repository at this point in the history
  • Loading branch information
YYsuni committed Feb 29, 2024
1 parent 00b2965 commit ef241a4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react18-json-view",
"version": "0.2.8-canary.2",
"version": "0.2.8-canary.3",
"type": "module",
"description": "JSON viewer for react18",
"main": "dist/cjs/index.cjs",
Expand Down
3 changes: 2 additions & 1 deletion src/components/json-view.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createContext, useCallback, useState } from 'react'
import { createContext, useCallback, useEffect, useState } from 'react'
import JsonNode from './json-node'
import type { Collapsed, CustomizeNode, DisplaySize, Editable } from '../types'
import { stringifyForCopying } from '../utils'
Expand Down Expand Up @@ -116,6 +116,7 @@ export default function JsonView({
const [_, update] = useState(0)
const forceUpdate = useCallback(() => update(state => ++state), [])
const [src, setSrc] = useState(_src)
useEffect(() => setSrc(_src), [_src])

return (
<JsonViewContext.Provider
Expand Down

0 comments on commit ef241a4

Please sign in to comment.