[Suggestion]: rename `useImperativeHandle` for clarity
Personne n'a encore pris cette issue.
- Langage dominant
- JavaScript
- Étoiles
- 11.8k
- Forks
- 7.9k
- Merge moyen
- 1 j 11 h
- PR mergées (30 j)
- 11
Description
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.
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par la page useImperativeHandle référencée à l’adresse react.dev/reference/react/useImperativeHandle et vérifiez si ce dépôt de documentation peut traiter un changement de nommage de l’API. L’issue n’est complète qu’une fois la proposition de nommage décidée ou la discussion redirigée vers le dépôt principal approprié.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- javascript, react
- Domaine
- documentation
- Type d'issue
- Fonctionnalité
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- Calme
- Clarté
- Plutôt claire
- Accessibilité débutants
- 25/100