callstack / callstack/react-native-paper

Not all componetns can receive ref

Ouverte
#3,729 0 commentaires 3 réactions 1 personne assignée Réclamée par @pac-guerreiro Voir sur GitHub
bug
Langage dominant
TypeScript
Étoiles
14.5k
Forks
2.2k
Merge moyen
5 j 23 h
PR mergées (30 j)
12

Description

### Current behaviour
Not all components can handle refs, although their prop types suggest that should be possible (eg. Avatar, Switch) and they trigger an error when you try to do it:

_Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?_

Ref can be pass to TextInput and IconButton only (?).

### Expected behaviour

All or at least most of the components should be able to receive ref, one of the reasons is being able to use Tooltip component with them without weird hacks.

### How to reproduce?

``

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.