Pergunta de entrevista da empresa StoryXpress

How can I stop re-rendering in React everytime state gets updated.

Respostas da entrevista

Sigiloso

27 de jul. de 2019

There is component life cycle called should component Update, by default it is set to true you need to set it to false in order to stop re renderning.

1

Sigiloso

12 de jul. de 2022

You can also use useCallback/useMemo to avoid re-rendering. Depend on the requirement.