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

chore: Access field ref instead of current value #347

Closed
wants to merge 11 commits into from

Conversation

diego3g
Copy link
Contributor

@diego3g diego3g commented Jan 27, 2021

Changes proposed

Currently we used to pass the ref.current value to registerField function, but with that Unform was referencing the current value and no the reference itself and sometimes we were losing track of the reference to get the field value.

Fixes #339.

@diego3g diego3g self-assigned this Jan 27, 2021
@vercel
Copy link

vercel bot commented Jan 27, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/rocketseat/unform/AKiBzzrLE4chJxmAnHifL8CdT971
✅ Preview: https://unform-git-feat-use-refs-instead-of-values-rocketseat.vercel.app

Currently we used to pass the ref.current value to registerField
function, but with that Unform was referencing the current value
and no the reference itself and sometimes we were losing track
of the reference to get the field value.

Fixes #339.
@diego3g diego3g force-pushed the feat/use-refs-instead-of-values branch from dfb0d23 to 633b272 Compare January 28, 2021 18:24
Base automatically changed from master to main January 28, 2021 18:30
@GustavoSchuler
Copy link

@diego3g vai rolar esse update?

@diego3g
Copy link
Contributor Author

diego3g commented Apr 7, 2022

@GustavoSchuler Vai sim, to subindo uma nova branch com uma v3 onde vai ter esse update e mais alguns outros.

@diego3g diego3g closed this Apr 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use of useRef is incorrect
3 participants