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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃く use input reference instead of custom object #9132

Merged
merged 3 commits into from Oct 26, 2022

Conversation

bluebill1049
Copy link
Member

@codesandbox
Copy link

codesandbox bot commented Oct 3, 2022

CodeSandbox logoCodeSandbox logo聽 Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2022

Size Change: -66 B (0%)

Total Size: 18.4 kB

Filename Size Change
dist/index.cjs.js 9.14 kB -36 B (0%)
dist/index.umd.js 9.26 kB -30 B (0%)

compressed-size-action

@Moshyfawn
Copy link
Member

Yea, I think it's a good idea since Controller is the primary way of dealing with RN inputs, where they need a lot of ref passing

@bluebill1049
Copy link
Member Author

yea 馃憤 and save lots of bytes for other features.

@bluebill1049 bluebill1049 marked this pull request as ready for review October 6, 2022 22:32
@bluebill1049 bluebill1049 merged commit e83b923 into master Oct 26, 2022
@bluebill1049 bluebill1049 deleted the feature/controller-ref branch October 26, 2022 07:20
bluebill1049 added a commit that referenced this pull request Nov 2, 2022
bluebill1049 added a commit that referenced this pull request Nov 2, 2022
@johannes-darms
Copy link

Are there any plans to continue with this feature? Would it make sense to implement an intermediate approach, e.g. ref returned along the existing structure?

@gps035
Copy link

gps035 commented Sep 8, 2023

I'm also interested in that intermediate approach. If it makes sense, I would be happy to open a PR to add an elm key so that users can access other methods on the input.

@timkindberg
Copy link

Not sure if it's relevant but I noticed that the reason I cannot use valueAsNumber with a controlled input is because a lot of the validation for valueAsNumber also checks the ref.value directly instead getting the value via other means. So I have controlled inputs that have a value in the UI but rhf sees them as empty because the ref object doesn't have a value prop. I was excited to see this thinking maybe I could upgrade and fix the issue but i see you reverted it.

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

Successfully merging this pull request may close these issues.

None yet

5 participants