Answer the question
In order to leave comments, you need to log in
How to do a rerender in react (hooks and d3.js)?
Hello. Please tell me exactly where I went wrong. In the next implementation, the task is to change the state and redraw the graph with new data. Instead, I recreate it.
https://codepen.io/gsdev99/pen/eYmYzKE
You can do the following in the draw() function:
d3.select(chart.current).html('')
But, I'm not sure if this is the right solution. In addition, it is assumed that the path should be redrawn animatedly.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question