Home > Mobile >  How do I prevent my chart from rerendering? (ReactJS)
How do I prevent my chart from rerendering? (ReactJS)

Time:10-11

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?

CodePudding user response:

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

CodePudding user response:

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

  • Related