davidkpiano / react-redux-form

Create forms easily in React with Redux.
https://davidkpiano.github.io/react-redux-form
MIT License
2.07k stars 251 forks source link

FieldArray getAll method returns undefined #1196

Closed depiction closed 5 years ago

depiction commented 5 years ago

The Problem

I have a multipage form that I created using the Wizard Form as an example. One of the two pages/forms has both field editing and view states. The editing state is complete. I'm trying to build the view state, which will be an unordered list with each item in the list representing an item in the FieldArray.

The getAll method doesn't return items in the FieldArray. Calling get() with an index returns an item from the FieldArray, so I know that there are items in the FieldArray.

Steps to Reproduce

I'm using React 16.2.0, Redux 3.7.2, and ReduxForm 7.2.0.

condition = this.props.fields.get(0)
console.log(condition) // displays: {attribute: "status", conditionValues: Array(1), qualifier: "equalToString"}
allConditions = this.props.fields.getAll()
console.log(allConditions) // displays: [undefined]

Expected Behavior

getAll() should return an array of objects

Actual Behavior

returns [undefined]