score:1
Accepted answer
you need to add a constructor to the class contact.
class contact extends component { constructor(props) { super(props); } ... };
putting dispatch(reset('contactform')) after return syntax, it would never get called. by the way, the action creator is supposed to be a pure function. adding dispatch action to it is not a good idea.
hope this help.
score:0
use
this.props.reset()
using this works on resetting the form after submit.
Source: stackoverflow.com
Related Query
- How to reset form on submission with Redux Form?
- How to reset initial value in redux form
- How to test form submission in React with Jest and Enzyme? Cannot read property 'preventDefault' of undefined
- How to connect simple Formik form with Redux store and dispatch an action?
- How to use Redux Form Wizard with permanent URLS per page
- How to reset a redux slice state with Redux Toolkit (RTK)
- How To Implement Google reCAPTCHA With Redux Form
- How to integrate redux with antd form validation
- How to pass input values from a child Form component to the state of its parent component for submission with react hooks?
- How to reset a react redux form split in different parts (Wizard form)?
- How to make a reset password form route with next.js
- How can I handle redux form submission in child component?
- React Redux - How do I build a form with material-ui that I can add inputs to?
- How do I use startsWith with a form submission when filtering array data from an API in React?
- How to reset form after successful sent Redux Form
- React Hook Form: How to reset the form content after submission
- How to test a redux form with async validation enabled
- With redux form how can I normalize and allow only positive integers on an input type number?
- How Can I save a blob file with a form submission using React.js + Django Rest Framework
- How to properly route after form submit in React with Redux app
- How to use a redux form width "Field" with Bootstrap
- How to validate field when rendering same field multiple time with different name id in redux form
- How to manage submission errors on react final form when using a redux action on onSubmit?
- how to fix form submission with useEffect hook (as is: need to click submit twice)
- How to reset the react form input value (which is tied to a state) with a button?
- How do you add/remove to a redux store generated with normalizr?
- Formik - How to reset form after confirmation
- How to implement a dynamic form with controlled components in ReactJS?
- How to type a Form component with onSubmit?
- How to test API request failures with Redux Saga?
More Query from same tag
- Attempted import error: 'alpha' is not exported from '@material-ui/core/styles'
- Use same GCP Load Balancer to route between GCS bucket and GKE
- Exporting methods in react component
- react-router, The prop `history` is undefined
- IOS emdash deletes previous character
- React Native I can not store an array with AsyncStorage
- Require an argument depending on the presence of another argument
- React won't update DOM on state change even though it's re-rendering
- Filter out null and empty values from JSON array in react
- How to get facebook uid in firebase using react?
- Get data from child component in react in parent
- Separate Navigation in React Native Navigation
- How can I declare a public function in an ES6 class?
- Using Promises properly in javascript
- Add button with onclick event to each row in datatable in react js
- Error: Cannot find module '/workspace/server.js'
- Trying to setup a countdown clock to a specific date with countdown,js in react
- Countdown time for multi row
- How handle long press event in react web
- Material UI Tree View, check if the node i click has children
- React: filter array list using Multiple CheckBoxes
- Reactjs - how can i make line break in template strings and return for rendering?
- Reference a Field's value in a FieldArray for className change
- React application with independent component routing
- How do i use props.theme.breakpoints with the makeStyles hooks?
- Add unique keys for items in reactjs
- onClick event doesn't work on styled-component but it works on everyother components
- Problem with using Material UI <Grid> for two column layout
- Loading state only when data is being fetched
- React Navlink changes url but not page