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

Consumer should pass in the ref #80

Open
melanieseltzer opened this issue Oct 14, 2022 · 2 comments
Open

Consumer should pass in the ref #80

melanieseltzer opened this issue Oct 14, 2022 · 2 comments
Assignees
Labels

Comments

@melanieseltzer
Copy link
Owner

We currently create the ref inside the hook and expose it to the consumer.

This works fine but also isn't very flexible. If the consumer wants to use another ref on the same element, they would have to merge the ref from our hook + the other one when attaching it to the element.

We should instead have the consumer pass the React.RefObject<HTMLInputElement | HTMLTextAreaElement> into the hook.

This would be a breaking change so we'd need to create a v2.0.0 release.

@logicalahara
Copy link

Hey @melanieseltzer, would love to contribute to this.

Will you please assign this to me ?

@melanieseltzer
Copy link
Owner Author

It's all yours, @logicalahara 😄 Thanks for the help!

For reference/a starting point, my original implementation when initially developing this hook (way back before releasing v1.0.0) had the ref getting passed in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants