Bug? Radio button field.input value === undefined all the time
See original GitHub issueHello Redux Form dev team.
I have a really funny question, i think i discovered a bug. Basicly when i start my form with the following values:
MyForm = reduxForm({
name: '',
startAt: '',
endAt: '',
isActive: true,
milestones: []
})(MyForm)
It runs the action @@redux-form/INITIALIZE and i can verify that the my-form.values.isActive = true
but when i then render the input field:
// Render function
renderRadio = ({ input, type }) => {
console.log(input.value); // this returns undefined even tho value is true in the store?
return <input {...input} type={type} checked={input.value} />
}
// Actual JSX
<Field name="isActive" component={this.renderRadio} type="radio" />
Is this a bug, or am i just completely missing something, happens now and then, i’ve already been looking on stack overflow and such and i should be doing it as described.
Cheers!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:4
- Comments:18 (1 by maintainers)
Top Results From Across the Web
Bug? Radio button field.input value === undefined all the time
If i change my input type to text, i can get input.value when i set it to radio it becomes undefined again. Is...
Read more >Radio button value returns undefined - jquery - Stack Overflow
It is strange since values are directly assigned with the proper method ,yet even alerted they are undefined.When i remove the value and...
Read more >Uncaught TypeError: Cannot read property of null - iDiallo
We want to get the value of an input. var inputVal = document. ... every time i try to run this, it shows...
Read more >Why is it impossible to deselect HTML "radio" inputs?
HTML 5.2 standard states all inputs should be unchecked if none has been marked checked: If none of the radio buttons in a...
Read more >flutter_form_builder | Flutter Package - Pub.dev
This package helps in creation of forms in Flutter by removing the boilerplate code, reusing validation, react to changes, and collect final user...
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
@Nopzen @status203 I made it work 👍
The trick seems to not set
type
in theField
props.Radio buttons are done with one
Field
perinput
each with the samename
prop. See the simple example: