final-form-focus icon indicating copy to clipboard operation
final-form-focus copied to clipboard

Use `form.getState()` directly instead of using subscriptions.

Open BowlingX opened this issue 6 years ago • 4 comments

Hi :),

I was running into timing issues on async error handling (with final-form 4.18.6 and react-final-form 6.3.3). (The promise in onSubmit would resolve before / at the same time the subscription callback fires and would compare against a stale state. I'm not sure why the subscription is needed because we have access to the form state directly with getState().

This pull request adresses the issue of a potential stale state.

BowlingX avatar Nov 27 '19 15:11 BowlingX

Codecov Report

Merging #16 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #16   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           5      5           
  Lines          44     40    -4     
  Branches       11     11           
=====================================
- Hits           44     40    -4
Impacted Files Coverage Δ
src/decorator.js 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c26b46e...56dee29. Read the comment docs.

codecov[bot] avatar Nov 27 '19 15:11 codecov[bot]

Any more information required to have this merged? :)

BowlingX avatar Dec 30 '19 13:12 BowlingX

I like how this simplifies things. Any reason we shouldn't merge this, @erikras?

TylerRick avatar Nov 04 '20 20:11 TylerRick

@erikras Could you please give some feedback on this issue. We're having the same problem in our projects and have to use fork of this library with similar patch applied.

mishaberezin avatar May 11 '21 14:05 mishaberezin