Add explanation on React event systems in documentation
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 11.8k
- Fork
- 7.9k
- Merge medio
- 1g 11h
- PR unite (30g)
- 11
Descrizione
Recently I come across a task to embed a React app into another project. It takes a torturing amount of time to learn the lesson that React events and native events are different in significant ways. This article greatly elaborates on it: https://fortes.com/2018/react-and-dom-events/
I didn't see any related details in event-related documentations in React though. It would save a lot of time for future readers if the documentation could contain the analysis and explanation of these points:
Avoid using addEventListener and rely on React event handlers
Listen on document (or window) if you want to receive events after all React handlers. Listen anywhere else in order to receive before React handlers
React event handlers will always execute after native capture handlers
Thanks.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Esamina la documentazione React esistente relativa agli eventi e l’articolo collegato su React-and-DOM events. Aggiungi una spiegazione che copra gli handler React rispetto a addEventListener, l’ordine dei listener su document o window e gli handler nativi di cattura; la documentazione dovrebbe permettere ai lettori di capire quando viene eseguito ciascun sistema di eventi.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, react
- Ambito
- documentation, frontend
- Tipo di issue
- Documentazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100