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

Forward refs to input component #608

Merged
merged 5 commits into from
Apr 19, 2020
Merged

Conversation

TylerRick
Copy link
Contributor

@TylerRick TylerRick commented Aug 27, 2019

Resolves #141

Still to do:

@TylerRick
Copy link
Contributor Author

All right, I added a test for this. So now I think the main blocker is this flow error:

[flow] Missing type annotation for `Config`. `Config` is a type parameter declared in function type [1] and was implicitly
[flow] instantiated at call of method `forwardRef` [2].

I haven't used Flow before (I use TypeScript), so I wouldn't know how to fix this. Could someone lend a hand please? ✋

@TylerRick TylerRick changed the title Wrap Field with forwardRef Forward refs to input component Aug 28, 2019
@ivchenkodima
Copy link

Any updates?

@kopax
Copy link

kopax commented Apr 8, 2020

can we get this released? This is so much needed in react native for the user experience: https://stackoverflow.com/questions/32748718/react-native-how-to-select-the-next-textinput-after-pressing-the-next-keyboar

I don't need flow validation I don't use typescript, is there a fork I can use to get this working?

@kopax
Copy link

kopax commented Apr 15, 2020

Someone really needs to kick this, it can't be a major fix and being stuck for soon a year.

kopax pushed a commit to kopax/react-final-form that referenced this pull request Apr 19, 2020
Added massive warning to avoid time lost for people wanting to use that library. This will cause a total reimplementation in our application, and should be clearly stated in the README.md

Related to :

- final-form#483
- final-form#779
- final-form#608
@erikras erikras merged commit eff0c20 into final-form:master Apr 19, 2020
@kopax
Copy link

kopax commented Apr 19, 2020

Thanks @erikras for taking care of it, that is somehow super important and I appreciate you took care of our remarks. Do you think this will be released soon?

@erikras
Copy link
Member

erikras commented Apr 19, 2020

I hope so. Flow has been a real pain for the past couple of years, blocking solid PRs like this one. At some point, FF and RFF will need to be rewritten into Typescript and Flow support dropped.

@erikras
Copy link
Member

erikras commented Apr 19, 2020

@kopax In your opinion, does this merge alleviate the need for #781?

@kopax
Copy link

kopax commented Apr 19, 2020

Yes, this was to push a little bit, I will close this PR, and also #779 as soon as we can test the new feature and validate it as fixed on our end.

@kopax
Copy link

kopax commented Apr 19, 2020

It seems that the CI prevent the release of being done: https://travis-ci.org/github/final-form/react-final-form/jobs/676834260 , perhaps #141 should be kept open until it's done?

@kopax
Copy link

kopax commented Apr 21, 2020

@erikras any update on that one? Perhaps it's possible to drop Flow type on just that file? Or at leaste release one version in a nighty channel?

@Nnanyielugo
Copy link

It doesn't seem like this release made it through. Is there a way this could be pushed through?
I had to use redux form for the one form that needed refs, and it seems a little too hackish.

Would be nice if this was looked into.

@kopax
Copy link

kopax commented May 3, 2020

@Nnanyielugo this is the issue for tracking, #483

I am also expecting to see this soon, I was about to remove RFF before they merged this. Any plan for this ?

@erikras
Copy link
Member

erikras commented May 27, 2020

Apologies for the delay. Since this was merged, I gave two conference workshops, one conference talk, and started two new jobs. Publishing today...

@erikras
Copy link
Member

erikras commented May 27, 2020

Published in v6.5.0.

@kopax
Copy link

kopax commented May 28, 2020

thanks for the release ! I would like to know if anyone have tested it ? Passing const ref = useRef(); to the <Field ref={ref} /> does not save the ref as I expect.

@SpadarShut
Copy link

SpadarShut commented Jun 5, 2020

@kopax I confirm, passing ref to Field does not set current to input, but instead sets it to the field instance. Using ReactDOM.

@SpadarShut
Copy link

Looks like the output of react-final-form-html5-validation.es.js does not contain the chenges from this PR.

@kopax
Copy link

kopax commented Jun 16, 2020

Thanks for sharing, It's a problem if it use react dom because it won't work in react native.

What's the status of this @erikras Is this now fixed and from what versIon?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2021
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.

Get Field Component via refs
6 participants