jquense / react-formal

Sophisticated HTML form management for React
http://jquense.github.io/react-formal
MIT License
526 stars 52 forks source link

Where did reactFormalContext go? #150

Open andres-gr opened 6 years ago

andres-gr commented 6 years ago

So it seems I had a very outdated version of react-formal, and now that I updated to the latest version I see that reactFormalContext is no longer being used.

Would like to know how does a child component of a <Form /> get access to the info from said component.

I would like to be able to access the current values of the form or the current errors if any, how can I access either of those values from a component inside a <Form />?

Also, I think the documentation at the moment is somewhat lacking.

jquense commented 6 years ago

Hey there, generally the best way to get access to the form values is via the Field component and a function child. Otherwise tho there isn't really a public low level API for that, especially as we are moving towards using the new context API. You can check out For trigger solve for how it accesses values I'd be careful tho the apis here are likely to change over the new few versions as I'm working on a lot of overhauls there, which will hopefully unlock a lot of potentially new features