Skip to content

Update React components to use React.forwardRef() #910

@joshblack

Description

@joshblack

Currently our Icon components are exported as plain functional components. It would be great if we included support for forwarding refs through React.forwardRef(), however this is only available past React v16.3. Currently, the project lists React v15 as a peer dependency.

It seems like we have a couple of paths forward:

  • Increase the peer dependency range, but still include v15, and try and feature detect forwardRef. This would land in a minor change to the package
  • Increase the peer dependency range explicitly to >=v16.3 and unconditionally use forwardRef. This would land in a major change to the package

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions