Archived
memo
allows you to optimize the rendering of a Functional Component by comparing the props by
-1
Community Evaluations
Philippe
04/03/2022
La question n'est pas bien formulée. React.memo réalise une comparaison de surface, donc par "valeur" de mon point de vue. Le fait que la réponse attendue soit "référence" signifie que vous ne vous focalisez que sur le props complexe de type objet ou fonction qui doivent rester identique (et donc la "valeur" de la référence doit rester la même) ; on est bien sur une comparaison par "valeur". Ou alors, reprendre la doc de React qui parle de "comparaison de surface".
29
Write the non-JSX equivalent of the following code:9
Use useCallback to optimize rendering in React25
Write the missing code to render the children of the UserProfile component.10
Write a React component that updates the document title with each click and resets to 'React App' when the component unmounts.16
Call a function on the first render of a React component15
Write a React component as a function14
Save the state used to display the selected page in a React component.