Skip to content

Not all componetns can receive ref #3729

Open
@szado

Description

@szado

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?

<Tooltip title="Username"><Avatar.Text label="U"/></Tooltip>

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions