question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose method of subscribing to form data

See original GitHub issue

Feature request: I would like to be able to subscribe to form updates for the purpose of autosave without submission. I am currently using FormSpy to do this but its render function is also triggered by parents rerendering:

<FormSpy subscription={{ values: true }}>
   {({ values }) => {
     onChange(values);
     return null;
   }}
</FormSpy>

It would nice if there was easy way to listen to updates without it also trigging on renders and gives the granularity subscriptions offer (debug is too noisy). I could get hold of reactFinalForm from context but this in not part of the public API.

One of the following would work for me:

  • An onChange prop on FormSpy
  • A simular component that accepts subcription and onChange as props
  • A component that fetches reactFinalForm from the context
  • reactFinalForm being exposed as a render prop on Form

Am I missing something, is there already a way to do this?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
erikrascommented, Dec 8, 2017

Published fix in v1.2.0.

0reactions
lock[bot]commented, Dec 8, 2018

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Best way to retrieve form data from a nested component in an ...
Best way to retrieve form data from a nested component in an Angular project - Stack Overflow. Stack Overflow for Teams – Start...
Read more >
Angular Reactive Forms: Tips and Tricks | by Netanel Basal
The way we get around this is by using the updateOn property. We can tell Angular that we only want to run the...
Read more >
How can I access data from Form outside react-final-form #419
So, I would like to acess the data from Form outside him, for example, I have multiple forms in only a page: props.reset()...
Read more >
Rethinking the Data Management for React Forms
A better way to handle form data and UI in React. ... Input fields call the exposed function when the user updates it....
Read more >
Sending a Request and Processing a Mapped Response to ...
In the above code, we used the createUsers() method to send our data to the server-side by using the POST Method. Here, we...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found