final-form / final-form/react-final-form

React Final Form Wizard with FieldArray and subscription throws error

Open
#848 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
7.4k
Forks
497
PR merge metrics
No merged PRs in 30d

Description

### Are you submitting a **bug report** or a **feature request**?

99% that's a bug and 1% the problem is in my hands.

### What is the current behavior?

Mixin of [React Final Form Wizard](https://final-form.org/docs/react-final-form/examples/wizard) with [FieldArray](https://github.com/final-form/react-final-form-arrays) and [subscription](https://final-form.org/docs/react-final-form/examples/subscriptions) throws error: "Cannot read property 'active' of undefined". The form still works and can be submitted if you ignore the error. If You remove subscription or FieldArray, the error disappear.

### What is the expected behavior?

There will be no errors on switching to the step of the form with FieldArray.

### Sandbox Link

[![Sandbox](https://camo.githubusercontent.com/416c7a7433e9d81b4e430b561d92f22ac4f15988/68747470733a2f2f636f646573616e64626f782e696f2f7374617469632f696d672f706c61792d636f646573616e64626f782e737667)](https://codesandbox.io/s/practical-volhard-p3rvj)

### What's your environment?

```
"final-form": "latest",
"final-form-arrays": "3.0.2",
"react": "latest",
"react-bootstrap": "1.3.0",
"react-dom": "latest",
"react-final-form": "latest",
"react-final-form-arrays": "3.1.2"
```

Contributor guide

Open the contributing guide

Research direction

Start with the linked CodeSandbox reproduction and compare switching wizard steps with FieldArray and subscription enabled against each feature removed. Trace the source of the “Cannot read property 'active' of undefined” error during the step change. Done means the combined setup switches steps without errors while remaining submittable.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.