From b03f49a7ceb737b548b60139c9b78cace1c2df1f Mon Sep 17 00:00:00 2001 From: Paul Henschel Date: Thu, 11 Mar 2021 01:18:31 +0100 Subject: [PATCH] fix line --- src/core/Line.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Line.tsx b/src/core/Line.tsx index 9c8631d0e..121513eca 100644 --- a/src/core/Line.tsx +++ b/src/core/Line.tsx @@ -37,9 +37,9 @@ export const Line = React.forwardRef(function Line( return geom }, [points, vertexColors]) - React.useEffect(() => { + React.useLayoutEffect(() => { line2.computeLineDistances() - }, [line2]) + }, [points, line2]) React.useLayoutEffect(() => { if (dashed) {