zakodium-oss / react-plot

Library of React components to render SVG 2D plots. You can check the story book https://react-plot.pages.dev/ or have a look to the extensive documentation
https://react-plot.zakodium.com
MIT License
12 stars 6 forks source link

Infinite loop in every Plot #387

Closed wadjih-bencheikh18 closed 2 years ago

wadjih-bencheikh18 commented 2 years ago

i found that there's an infinite loop in every plot

after searching i found that the problem is in this useMemo https://github.com/zakodium-oss/react-plot/blob/ae14c2c36260f258e63a95eaad93b38190fe1611/src/contexts/plotContext.ts#L192

after checking hook dependency, the problem was with state.axes

when i removed state.axes dependency from the hook everything is running perfectly (even NMR example)