Skip to content

Commit

Permalink
fix(Outline): dispose on unmount (#254)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodyJasonBennett authored Nov 9, 2023
1 parent 3df78a9 commit 220d2b5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/effects/Outline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,5 +105,11 @@ export const Outline = forwardRef(function Outline(
}
}, [api, effect.selection, invalidate])

useEffect(() => {
return () => {
effect.dispose()
}
}, [effect])

return <primitive ref={forwardRef} object={effect} />
})

0 comments on commit 220d2b5

Please sign in to comment.