3 ms·
from the article: "So, to go back to our misconception: props have nothing to do with re-renders."
by aarpmcgee 4y ago
from the article: "So, to go back to our misconception: props have nothing to do with re-renders."
- ummonk 4y agoAnd nevertheless React.Memo does exactly what they said - it prevents a component from rerendering unless it’s props change. Likewise useMemo can be used for a similar function - to prevent a component from rerendering unless the dependencies to the useMemo call change.
- patrickthebold 4y agoOops meant React.memo not useMemo https://reactjs.org/docs/react-api.html#reactmemo https://reactjs.org/docs/react-api.html#reactmemo