Mutating state in place and calling setState will not cause a re-render.
Modifier l'état local en place et appeler setState ne causera pas de rafraîchissement.
Never mutate this.state directly, as calling setState() afterwards may replace the mutation you made.
Ne modifiez jamais this.state directement, car appeler setState() par la suite risque d'écraser les modifications que vous auriez apportées.
This makes reading this.state right after calling setState() a potential pitfall.
En conséquence, lire la valeur de this.state juste après avoir appelé setState() est une mauvaise idée.
When a parent schedules an update by calling setState, by default React reconciles its whole child subtree.
Quand un parent planifie une mise à jour en appelant setState, React réconcilie par défaut tout l'arbre de ses enfants.
Calls to setState are asynchronous - don't rely on this.state to reflect the new value immediately after calling setState.
Les appels à setState sont asynchrones : ne comptez pas sur this.state pour refléter la nouvelle valeur immédiatement après avoir appelé setState.
If mutable objects are being used and conditional rendering logic cannot be implemented in shouldComponentUpdate(), calling setState() only when the new state differs from the previous state will avoid unnecessary re-renders.
Si vous y utilisez des objets modifiables et que la logique de rendu conditionnel ne peut pas être implémentée dans shouldComponentUpdate(), appeler setState() seulement quand le nouvel état diffère du précédent évitera des rafraîchissements superflus.
In the event of an error, you can render a fallback UI with componentDidCatch() by calling setState, but this will be deprecated in a future release.
Si une erreur survient, vous pouvez déclencher l'affichage d'une UI de remplacement avec componentDidCatch() en appelant setState, mais une future version de React dépréciera cette possibilité.
Potentieel gevoelige of ongepaste informatie
Er worden alleen voorbeelden gegeven om u te helpen het woord of de woordcombinatie waarop u hebt gezocht, te vertalen. Deze worden niet door ons geselecteerd of gevalideerd en kunnen ongepaste taal bevatten. Wij vragen u melding te maken van voorbeelden die dienen te worden aangepast of verwijderd. Vertalingen met grof of informeel taalgebruik worden meestal rood of oranje gemarkeerd.