-2

So everytime I use setState my component rerenders. But I don't want my chart to rerender. My question is how do I prevent my chart from rerendering?

2 Answers2

1

Create a new component for the chart. Prevent the rerender by memoizing it with Higher Order Component memo.

Ploppy
  • 14,810
  • 6
  • 41
  • 58
0

Though the issue is not very clear, but You can use useRef which does not Re-renders the UI.

shiv k
  • 24
  • 4