MutterCorp
MutterCorpNotice · Notícias
Programação·

React : useMemo – Interview Questions

Q1. What is useMemo in React? useMemo is a React Hook used to memorize the result of an expensive calculation. It prevents recalculating the value on every render unless its dependencies change. *Syntax : * const memoizedValue = useMemo(() => { return calculation; }, [dependencies]); Q2. Why do we use useMemo? We use useMemo to: Avoid unnecessary calculations. Improve application performance. Cache calculated values between renders. Q3. What happens if we don't use useMemo? The calculation exec…

Publicado no Notice. Categoria: Programação.

Notícias sobre o mesmo assunto em outras fontes