Skip to content

Commit

Permalink
fix: create separate instances for container instances
Browse files Browse the repository at this point in the history
  • Loading branch information
r281GQ committed Aug 30, 2024
1 parent 7135e47 commit 18f407d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,16 @@ VictoryVoronoiContainer.defaultEvents = (
? {}
: handler(event, { ...props, ...targetProps }, eventKey, context);

const voronioHelper = new VoronoiHelpers();

return [
{
target: "parent",
eventHandlers: {
onMouseLeave: createEventHandler(VoronoiHelpers.onMouseLeave),
onTouchCancel: createEventHandler(VoronoiHelpers.onMouseLeave),
onMouseMove: createEventHandler(VoronoiHelpers.onMouseMove),
onTouchMove: createEventHandler(VoronoiHelpers.onMouseMove),
onMouseLeave: createEventHandler(voronioHelper.onMouseLeave),
onTouchCancel: createEventHandler(voronioHelper.onMouseLeave),
onMouseMove: createEventHandler(voronioHelper.onMouseMove),
onTouchMove: createEventHandler(voronioHelper.onMouseMove),
},
},
{
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-voronoi-container/src/voronoi-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,4 +260,4 @@ class VoronoiHelpersClass {
});
}

export const VoronoiHelpers = new VoronoiHelpersClass();
export const VoronoiHelpers = VoronoiHelpersClass;

0 comments on commit 18f407d

Please sign in to comment.