callstack / callstack/react-native-paper

Not all componetns can receive ref

Open
#3,729 0 comments 3 reactions 1 assignee Claimed by @pac-guerreiro View on GitHub
bug
Dominant language
TypeScript
Stars
14.5k
Forks
2.2k
Avg merge
5d 23h
Merged PRs (30d)
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?

``

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.