[Suggestion]: rename `useImperativeHandle` for clarity
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- javascript, react
- Bereich
- documentation
Rechercherichtung
Beginne mit der referenzierten useImperativeHandle-Seite unter react.dev/reference/react/useImperativeHandle und prüfe, ob dieses Dokumentations-Repository eine Änderung der API-Namensgebung behandeln kann. Das Issue ist erst abgeschlossen, nachdem der Namensvorschlag entschieden wurde oder die Diskussion an das zuständige Haupt-Repository weitergeleitet wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Summary
[!NOTE]
This is not specific to the docs site but I could not find an appropriate issue to file this under the main repo. Is this the appropriate place to discuss API naming and offer suggestions? If not, please let me know where I should redirect my question!
While the docs page does a good job of explaining how and when useImperativeHandle is used, I think it would be much clearer if the API were renamed to useProxy, useProxiedRef, useReflectedRef, or some other similar name as it makes it clearer that all you are doing is reflecting/proxying a ref that is passed in by consumers.
Page
https://react.dev/reference/react/useImperativeHandle
Details
"imperative" in imperativeHandle is unclear, should it be interpreted as important/necessary or imperative in the programming sense? Either way I don't think it's easy to understand. I've used this hook enough times by now that I am familiar with when/why it's needed but to someone new to React this is probably one of the more obscure hooks. Handle is also unclear as that has other meanings in other programming languages. I think "proxy" is a more universally understood term for "wrap/modify/mock something and pass it along" which is what this hook is doing.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 11.8k
- Forks
- 7.9k
- Ø Merge
- 16 Std. 6 Min.
- Gemergte PRs (30 T.)
- 7
Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus reactjs/react.dev
-
type: documentation
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
-
bug: unconfirmed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
-
type: typos
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
-
bug: unconfirmed
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Alle Issues in reactjs/react.dev
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
-
Theme loads third-party resources on every page (jsdelivr web font, cdnjs Font Awesome) – GDPR Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id Offenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
nightscout/nocturne#1414 ·
-
bug v2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
modelcontextprotocol/inspector#2458 · 1 Kommentar ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100
carbon-design-system/ibm-products#9907 ·