`Getters` in redux-form props
See original GitHub issueRedux form provide wide list of props - http://redux-form.com/6.6.0/docs/api/Props.md/
One can find a lot of write commands, and a few constants one can read(ie form
).
But there is not build in
command to read value from or, for example, get current variable prefix from FormSection (to build name to read).
First case can be solved via Selectors, but it will not be easy, and clear - you should combine state and form name. And you dont know form name.
Second can can not be solved.
What about embedding selectors inside first-level props?
Issue Analytics
- State:
- Created 6 years ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
props - Redux Form
Sets the value and marks the field as autofilled in the Redux Store. This is useful when a field needs to be set...
Read more >props - Redux Form
Sets the value and marks the field as autofilled in the Redux Store. This is useful when a a field needs to be...
Read more >Selecting Form Values Example - Redux Form
... submitting } = props return ( <form onSubmit={handleSubmit}> <div> <label>First Name</label> <div> <Field name="firstName" component="input" type="text" ...
Read more >How can I insert a reduxForm component without starting too ...
I am using a MERN stack overall, but I think this question only applies to react and redux form. Whenever I include a...
Read more >Create Forms Easily with React and Redux
LocalForm (props); function react-redux-form.batched (reducer, initialState) ... localPath, getter(initialState, localPath)); default: return state; ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@theKashey are you talking about a field’s other attributes, such as syncError or dirty? There are other ways of obtaining that information, such as through selectors.
The main reason why you need a selector rather than a
this.props.get(fieldName)
is that a selector will rerender your component, and the other won’t.One of the main design goals of
v6
was to allow individual fields to be rerendered without necessarily having to rerender the entire form.For a contrived example, let’s say you want to print out “full name” in your form, so you do:
As you type into the
firstName
field, you would expect the Full Name<div>
to change, but it won’t, because the form’srender()
method is not being called on every keypress.Make sense?