Skip to content

Radio Button Group defaultChecked prop Not Working #3784

Discussion options

You must be logged in to vote

Hi there

If you could provide a simple reproduction of your issue in a codesandbox that would be helpful.

Initial thoughts though, are that Dosu is hinting you in the right direction, with controlled and uncontrolled input components in React.

Just like Radio group, or any radio button control when using React, you can't mix controlled and uncontrolled when using a component. Furthermore, you can't use defaultChecked on checkboxes or radios when the component is controlled by your state. Your state must control the checked state of the component.

From that code snippet, that's what you seem to be doing, controlling state but trying to render the radio's checked status as if it was an unco…

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@ehsaan-changa
Comment options

Comment options

You must be logged in to vote
1 reply
@ehsaan-changa
Comment options

Answer selected by SiTaggart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External This Discussion was posted by a non-Twilio Paste consumer
3 participants