You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 28, 2021. It is now read-only.
If you run the app, what you will notice is that the selectedOption in state is correctly updated, but the radio button state does not change; the first radio button ("one") will remain selected.
This appears to be caused by the fact that I'm storing the RadioGroup JSX inside of the state (however, the issue is the same if I store it as an instance variable).
I need to be able to dynamically generate and pass the RadioGroup component to other props in an app which I'm working on. How can I get around this issue?
The text was updated successfully, but these errors were encountered:
Whoops, I thought I was replying to another issue - I removed my comment. I never resolved the issue. I ended up building a different component and not using radio buttons.
I found the same problem was happening, so I decided to use the onClick handler, as an attribute of each Radio element, rather than the onChange handler, as an attribute of the RadioGroup element, and hey presto, everything worked perfectly:
Here is the code for the sample app:
I have the test app up on GitHub as well: https://github.com/chipit24/react-mdl-radio-group-test
If you run the app, what you will notice is that the
selectedOption
in state is correctly updated, but the radio button state does not change; the first radio button ("one") will remain selected.This appears to be caused by the fact that I'm storing the RadioGroup JSX inside of the state (however, the issue is the same if I store it as an instance variable).
I need to be able to dynamically generate and pass the RadioGroup component to other props in an app which I'm working on. How can I get around this issue?
The text was updated successfully, but these errors were encountered: