[request] FormSpy should receive FormApi
See original GitHub issueAre you submitting a bug report or a feature request?
feature request
What is the current behavior?
FormSpy
provides access to internal FormState
, but does not expose a way to comprehend the registered fields.
What is the expected behavior?
FormSpy
is passed FormApi
in addition to FormState
so that one may call getRegisteredFields: () => string[]
What’s your environment?
RFF v2.1.1 React v16.2.0
Workaround
It looks like I can get FormApi
from the context as reactFinalForm
, but I think it a useful addition to provide the FormApi
to the FormSpy
unless there is a reason to protect it.
BTW - so far everything has been fantastic. Very solid library, almost no issues converting a mature codebase from react-formal over to this.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Final Form Docs – `<FormSpy/>`
A component that subscribes to form state, and injects both form state and the form instance via a render prop. The <FormSpy/> will...
Read more >FormSpy: provide form API to onChange callback #412 - GitHub
Are you submitting a bug report or a feature request? Feature request What is the current behavior? The FormSpy#onChange callback is only ...
Read more >Forms API Overview - HubSpot API
Using the Forms API You can select from two different endpoints: Submit data to a form (Supporting Authentication) Submit data to a form....
Read more >Simple way to update form values depending on changes with ...
Here is a version with a combination of FormSpy component, useRef hook and the form.reset api. https://codesandbox.io/embed/react-final-form- ...
Read more >The Forms API - Django documentation
This document covers the gritty details of Django's forms API. ... The validation routines will only get called once, regardless of how many...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That is so far the only reason I need to access the context. I have component that is a catch all for errors that do not match current fields (e.g. field level validation vs record level validation) and displays them above the submit.
Here’s the use:
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.