score:1
well, the problem was using a bad form reducer, probably taken from an outdated example:
import { reducer as formreducer } from 'redux-form/immutable';
its a stupid mistake but i expect a descent error message. ofcourse the right usage is:
import { reducer as reduxformreducer } from 'redux-form';
score:0
nothing is being rendered, probably, because you have no employees and you don't render the renderemployees
component when the employee list is empty.
if you want to have at least 1 employee, in such a way that it will render an empty item, you can pass initialvalues
to the form, passing the array with an empty item.
this is a modified version of the fieldsarray
example you provided, in which there's 1 initial member.
const initialvalues = {
"members": [
{
"firstname": "",
"lastname": "",
"hobbies": []
}
]
}
reactdom.render(
<provider store={store}>
<div style={{ padding: 15 }}>
<h2>field arrays</h2>
<fieldarraysform onsubmit={showresults} initialvalues={initialvalues} />
<values form="fieldarrays" />
</div>
</provider>,
rootel,
);
example in codesandbox:
Source: stackoverflow.com
Related Query
- Redux Form - FieldsArray - fields is empty, length is 0
- Auto save form fields in react and redux
- Redux form onSubmit values empty object in testing
- Redux Form HandleSubmit data empty
- react enable button after all form fields are not empty
- React Form Submission - Fields Always Empty
- Do partial reset of redux form fields
- Render Redux Form fields programmatically
- How to use Normalize in Redux - Form Fields component
- Validate string length and make sure it contains certain characters in React Redux Form
- How to disabled button when form fields is empty or invalid in Ionic 2
- React final form disables fields without redux
- material-ui Date Picker saves empty value as Date(0) in Redux Form
- How to disable entire redux form after submitting and then re-enable it after clearing all fields
- How can I set validation rules when all fields are empty React Hook Form
- Redux Form error on submit empty search value query
- why the donor card disppear and the form become empty when I change the route in React js using Redux
- update depth exceeded using redux form fields array
- reactjs material-ui and redux form fields -- creating component
- Redux Form decorator not working, so can't initialize fields
- React + Redux - What's the best way to handle CRUD in a form component?
- Clear and reset form input fields
- How to reset initial value in redux form
- Redux Form - initialValues not updating with state
- Error withRef is removed. To access the wrapped instance, use a ref on the connected component when using Redux Form
- Redux form defaultValue
- Set value in field in redux form
- How do you pass in a dynamic form name in redux form?
- How to clear some fields in form - Redux-Form
- Submit button from outside Redux Form v6.0.0
More Query from same tag
- Custom react hook to fetch data is not giving data on second hit
- React how to avoid css overide other components?
- Debouncing in react with multiple factors
- Testing nested JSX with React Testing Library
- React-countdown-now not updating on render
- How to change useState variable in the same function
- Is there an way to wait for event that trigger async function in Jest/Enzyme?
- How to prevent VS Code from auto-tabbing to browser while running nodemon?
- Styling links in react
- Typescript - React/Redux to display table
- Does React have an equivalent for Angular's DatePipe?
- Update React State variable inside an Interval
- Read the setState value immediately after setting in useEffect React
- Why ant design Drawer not showing close icon?
- Formik + Yup accessing errors for nested values
- Pass data between independent component react and redux
- Can not change the default value of <select> useing the react states
- Scroll to other component in reactjs
- RTCRecorder: TypeError Recorder is not a constructor
- what is the event that needed to use for multiselect in React
- How to call a Component which name is passed as props in React?
- Jest onSpy does not recognize React component function
- React: Why does Babel not polyfill String.prototype.replaceAll?
- React + Typescript: Property * is missing in type *
- React/Redux - Why this Promise.all continues to execute after dispatch?
- How to make props safe in jsx like jinja2
- `_Symbol.'for'`: Is that actually valid ES6? Webpack built it from React source
- How to send "token" to "Api" in "react"
- Treating warnings as errors because process.env.CI = true. Failed to compile
- testing a function in jest javascript