Suggest improving hook API reference signatures
Nessuno ha ancora preso questa issue.
- Lingua principale
- JavaScript
- Stelle
- 11.8k
- Fork
- 7.9k
- Merge medio
- 1g 11h
- PR unite (30g)
- 11
Descrizione
A user on Reddit pointed out that the Hooks API Reference page section for useEffect doesn't include the deps array in the signature - it's just useEffect(callback). The deps array is only described later on under the heading "Conditionally Firing an Effect".
Similarly, the entry for useLayoutEffect() doesn't even show a signature at all - it just says "the signature is identical to useEffect".
At a minimum, the useEffect signature should show that there's an optional second argument - the deps array. It would also help to show the signature for useLayoutEffect as well.
Reddit link reference: https://www.reddit.com/r/reactjs/comments/b0oh20/usedimensions_a_react_hook_to_measure_dom_nodes/eigiqud/
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
Inizia dalla pagina Hooks API Reference ed esamina le voci useEffect e useLayoutEffect. Il lavoro è completato quando useEffect mostra il proprio array deps opzionale e useLayoutEffect ha una firma esplicita, mantenendo coerenti le spiegazioni circostanti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, react
- Ambito
- documentation
- Tipo di issue
- Documentazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100