Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using pass-through refs and instead use forwardRef #14672

Closed
8 tasks
Tracked by #24660
t3chguy opened this issue Jul 21, 2020 · 1 comment
Closed
8 tasks
Tracked by #24660

Stop using pass-through refs and instead use forwardRef #14672

t3chguy opened this issue Jul 21, 2020 · 1 comment
Labels
Help Wanted Extra attention is needed T-Epic Issue is at Epic level T-Task Tasks for the team like planning

Comments

@t3chguy
Copy link
Member

t3chguy commented Jul 21, 2020

Why?

The forwardRef function is React’s standard way to expose DOM nodes from components to their parents. Using this spares us having to define custom reference parameters in property interfaces.

Reference: React docs: https://beta.reactjs.org/reference/react/forwardRef

What?

We’ll do away with any custom pass-through ref parameters such as inputRef or innerRef and replace them with forwardRef calls.

Plan

This can be split into tasks consisting of each component which accepts an inputRef or innerRef (name doesn't matter) ref pass-through - involves updating it to use forwardRef and updating all consumers of that Component to use ref.

Tasks

Internal references

myhours: https://app.myhours.com/#/projects/1975122/overview

@turt2live turt2live added T-Task Tasks for the team like planning S-Minor Impairs non-critical functionality or suitable workarounds exist Help Wanted Extra attention is needed O-Uncommon Most users are unlikely to come across this or unexpected workflow A-Developer-Experience labels Jun 13, 2022
@Johennes Johennes changed the title we should stop using inputRef and instead use forwardRef Stop using inputRef and instead use forwardRef Feb 6, 2023
@Johennes Johennes changed the title Stop using inputRef and instead use forwardRef Stop using pass-through refs and instead use forwardRef Feb 23, 2023
@Johennes Johennes added T-Epic Issue is at Epic level A-Tech-Debt and removed S-Minor Impairs non-critical functionality or suitable workarounds exist A-Developer-Experience O-Uncommon Most users are unlikely to come across this or unexpected workflow labels Mar 1, 2023
@Johennes Johennes changed the title Stop using pass-through refs and instead use forwardRef ⭐️ Stop using pass-through refs and instead use forwardRef Mar 2, 2023
@t3chguy t3chguy self-assigned this Mar 9, 2023
@t3chguy t3chguy removed their assignment Mar 9, 2023
@t3chguy
Copy link
Member Author

t3chguy commented Mar 27, 2023

Due to typing restrictions this isn't really feasible, forwardRef asserts Ref which can be RefCallback or RefObject, most of our usages require RefObject so we will need to maintain this non-standard behaviour

@t3chguy t3chguy closed this as completed Mar 27, 2023
@Johennes Johennes changed the title ⭐️ Stop using pass-through refs and instead use forwardRef Stop using pass-through refs and instead use forwardRef Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Extra attention is needed T-Epic Issue is at Epic level T-Task Tasks for the team like planning
Projects
None yet
Development

No branches or pull requests

3 participants