Facile
Qu'est-ce que la fonctionnalité Concurrent Mode introduite dans React ?
Auteur: Vincent CotroStatut : PubliéeQuestion passée 2057 fois
Modifier
1
Évaluations de la communauté
Réponse incorrecte
Madaa20/01/2025
Question: What is the Concurrent Mode feature introduced in React?
Analysis of Each Answer
1. It provides the ability to run multiple instances of React in parallel for improved performance.
Why it's incorrect:
This statement suggests that React is executing multiple instances in parallel. However, Concurrent Mode does not involve running multiple instances of React simultaneously. Instead, it enables React to manage its updates more efficiently, allowing React to "interrupt" long-running updates and prioritize other tasks, which makes the UI more responsive.
2. It enhances user interface responsiveness by making the execution of multiple tasks simultaneously possible.
Why it's incorrect:
This statement implies that React runs tasks simultaneously, which is misleading. React's Concurrent Mode doesn't run tasks in parallel. It just allows React to schedule updates in such a way that higher-priority updates can be processed first, improving the user experience. It makes the interface more responsive by enabling better scheduling and interrupting non-essential updates.
Correct Answers:
It allows React to prioritize important updates and schedule less important ones.
It improves the responsiveness of the user interface by allowing React to interrupt long-running tasks.
9
Utiliser useCallback pour optimiser le rendu en React28
Écrire l'équivalent non-JSX du code suivant :25
Écrire le code manquant pour afficher les enfants du composant UserProfile.10
Écrire un composant React qui met à jour le titre du document à chaque clic et le réinitialise à 'React App' lorsque le composant se démonte.15
Écrire un composant React en tant que fonction15
Appeler une fonction au premier rendu d'un composant React14
Enregistrer l'état utilisé pour afficher la page sélectionnée dans un composant React.