Questions tagged [redux-form]

Redux Form works with React and Redux to enable a form in React to use Redux to store all of its state.

Redux Form works with React and Redux to enable a form in React to use Redux to store all of its state.

Some features include:

  • Field values persistence via Redux store
  • Validation (sync/async) and submission
  • Formatting, parsing and normalization of field values

Redux Form can be used with raw HTML5 inputs, but it also works with very well with common UI frameworks like Material UI, React Widgets and React Bootstrap.

Git Hub repository - https://github.com/erikras/redux-form/

Examples - https://redux-form.com/6.7.0/examples/

2396 questions
87
votes
11 answers

How to enable file upload on React's Material UI simple input?

I am creating a simple form to upload file using electron-react-boilerplate with redux form & material ui. The problem is that I do not know how to create input file field because material ui does not support upload file input. Any ideas on how to…
gintoki27
  • 1,021
  • 1
  • 7
  • 11
72
votes
6 answers

Set min/max on TextField type="number"?

I'm using Material-UI v1.0.0-beta23 along with redux-form and redux-form-material-ui. I have a Field that is type number and I want to set the min and max values on the tag. I've tried both inputProps and min/max and neither seem to do what I want.…
Mike Suiter
  • 883
  • 1
  • 7
  • 12
61
votes
5 answers

I am using Redux. Should I manage controlled input state in the Redux store or use setState at the component level?

I have been trying to figure out the best way to manage my react forms. I have tried to use the onChange to fire an action and update my redux store with my form data. I have also tried creating local state and when my form gets submitted I trigger…
gkkirsch
  • 1,696
  • 1
  • 14
  • 14
50
votes
6 answers

Redux-Form initial values from

I'm trying to fill the profile form with data from API. Unfortunately redux-form doesn't want to cooperate with me in this case. For some reason fields stays empty whatever I do. Setting the fixed values instead of values passed from reducer work…
J33nn
  • 2,784
  • 4
  • 24
  • 43
39
votes
1 answer

Programmatically change Redux-Form Field value

When I use redux-form v7, I find there is no way to set the field value. Now in my form, I have two select component. The second's value will be clear when the first select component value changed. In class render:
taven
  • 443
  • 1
  • 5
  • 10
36
votes
2 answers

redux-form is Destroying my state once the component is unmounted, what gives?

I am not passing in any special config settings nor am I setting/or calling Destroy... but my state is being cleaned... anyway to prevent this? I need the state to stick around as I need that data thruout my application. prev state: I see it in…
james emanon
  • 8,958
  • 7
  • 40
  • 66
30
votes
4 answers

Redux-form handleSubmit: How to access store state?

In a redux-form handleSubmit function, which makes an Ajax call, some properties from the Redux state are needed in the Ajax (e.g. user ID). This would be easy enough if I wanted to define handleSubmit in the form's component: Just call…
stone
  • 7,288
  • 4
  • 48
  • 62
29
votes
8 answers

How to upload file with redux-form?

I can't get correct value into the store when trying to upload a file. Instead of file content, I get something like { 0: {} }. Here's the code: const renderInput = field => (
{ …
Mike Doudkin
  • 590
  • 1
  • 5
  • 15
28
votes
8 answers

Using redux-form I'm losing focus after typing the first character

I'm using redux-form and on blur validation. After I type the first character into an input element, it loses focus and I have to click in it again to continue typing. It only does this with the first character. Subsequent characters types remains…
Gregg
  • 31,994
  • 13
  • 93
  • 189
28
votes
1 answer

How to embed the same redux-form multiple times on a page?

I'm having an issue trying to embed multiple forms on one page. I noticed configForm executes once, even with multiple forms on the page, that's why I can't dynamically generate different form names. Screenshot showing multiple text fields bound…
Kyle
  • 313
  • 3
  • 6
27
votes
5 answers

How to reset initial value in redux form

I'm using redux-form. I'm showing initial values in input fields from the state. When I click on reset, the input field is still showing initial values. How can I reset the input field? This is my code : const mapStateToProps = (state) => { …
Sunil tc
  • 1,731
  • 3
  • 15
  • 36
25
votes
5 answers

Error withRef is removed. To access the wrapped instance, use a ref on the connected component when using Redux Form

I am trying to get Redux Form to work for the first time and I am getting the following error: Invariant Violation withRef is removed. To access the wrapped instance, use a ref on the connected component. What am I doing wrong? The error is…
Mimo
  • 5,707
  • 5
  • 33
  • 45
25
votes
3 answers

Redux Form - initialValues not updating with state

I am having some issues with setting the inital form field values using redux-form. I am using redux-form v6.0.0-rc.3 and react v15.3.0. So here's my issue, I have a grid of users and when a user row is clicked on, I am navigating to an edit users…
country_dev
  • 555
  • 3
  • 12
  • 22
25
votes
6 answers

How to set initialValues based on async source such as an ajax call with redux-form

On the official pages and in the GitHub issues for redux-form there are more than one example of how to work with initialValues however I cannot find a single one that focuses on explaining how initialValues can be set in response to an asynchronous…
jpierson
  • 13,736
  • 10
  • 94
  • 137
24
votes
2 answers

Set value in field in redux form

I have redux form having dropdown and text fields. On dropdown change i have to update the other fields. The other fields are using custom component example So the structure is like. 1. component having form 2. Field component. Now i googled…
Rahul Tailwal
  • 3,073
  • 3
  • 11
  • 26
1
2 3
99 100