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) {