callstack / callstack/react-native-paper

Not all componetns can receive ref

未关闭
#3,729 0 条评论 3 个 reaction 已指派 1 人 已被 @pac-guerreiro 认领 在 GitHub 查看
bug
主要语言
TypeScript
星标
14.5k
派生
2.2k
平均合并
5 天 23 小时
30 天内合并 PR
12

描述

### 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?

``

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。