Skip to content
This repository has been archived by the owner on Dec 6, 2022. It is now read-only.

Enable ref forwarding for leaf components #294

Closed
SiAdcock opened this issue Mar 25, 2020 · 2 comments
Closed

Enable ref forwarding for leaf components #294

SiAdcock opened this issue Mar 25, 2020 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@SiAdcock
Copy link
Contributor

Is your feature request related to a problem? Please describe.

In React, refs provide a reference to the DOM element associated with a React element. However React components cannot directly accept ref props.

Describe the solution you'd like

We need a way to access references to DOM elements associated with instances of Source components. Possible implementations would be:

  • Ref forwarding
  • Passing a ref prop with a different name (e.g forwardedRef), which gets passed as a ref within the component.

Additional context

This is blocked by an issue at the intersection of forwardRef, defaultProps and TypeScript. (partially fixed and explained here, but this doesn't address the forwardRef case)

@SiAdcock SiAdcock added the help wanted Extra attention is needed label Mar 25, 2020
@SiAdcock
Copy link
Contributor Author

Hi @liywjl 👋

I'm raising this after we discussed it many weeks ago! I did try to fix it but became bogged down by TypeScript issues. Did you find a way of making this work without any changes to Source?

@SiAdcock
Copy link
Contributor Author

Not much action on this, so I'm closing for now. Feel free to re-open if this is still causing a problem

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant