Skip to content

Commit

Permalink
fix: use createRoot in lazyVisualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
yojenkins committed Jan 10, 2025
1 parent 8b5b9f2 commit ec44db6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lazyVisualizer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { lazy, Suspense, useEffect } from 'react'
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import * as ReactDOM from 'react-dom/client'
import type { ActionLog } from './ActionLog'
import type { ActionWithStateMetadata } from './types'

Expand Down Expand Up @@ -90,11 +90,11 @@ export function useVisualizer({
Object.assign(document.createElement('div'), { id: targetElementId })
if (!existingElement) document.body?.append(rootEl)
}
ReactDOM.render(
const root = ReactDOM.createRoot(rootEl)
root.render(
<Suspense fallback={null}>
<LazyTimingDisplay {...props} enabled={enabled} />
</Suspense>,
rootEl,
)
}, [enabled])
}

0 comments on commit ec44db6

Please sign in to comment.