Skip to content

Commit

Permalink
only attach once to canvas
Browse files Browse the repository at this point in the history
  • Loading branch information
korbinian90 committed Jun 20, 2024
1 parent 83b15ca commit ba7103c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion niivue/src/components/NiiVueCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const NiiVueCanvas = ({
}: AppProps & NiiVueCanvasProps) => {
const canvasRef = useRef<HTMLCanvasElement>()
useEffect(() => {
canvasRef.current && nv.attachToCanvas(canvasRef.current)
canvasRef.current && !nv.canvas && nv.attachToCanvas(canvasRef.current)
}, [canvasRef.current])
useEffect(() => {
if (!nv.body) {
Expand Down

0 comments on commit ba7103c

Please sign in to comment.