无法获得 Material UI 单选按钮以使用 Formik 第二部分
Cannot get Material UI radio buttons to work with Formik Part Two
之前,我曾在Material UI 和 Formik 此处寻求帮助以获取单选按钮:. Luckily, I got a fix for it, but unfortunately it did not work for our application. Therefore, I have developed a code sandbox that more closely matches our environment, with the solution that was given in the previous question. Can anyone give advice on how to get it to work? For more details, we wrap Material UI, in this case the Radio.js class. This allows us to leverage it in different projects/repos. Here is the code sandbox: https://codesandbox.io/s/recursing-colden-0oo63。谢谢!
你是说单选按钮没有进入选中状态?
您没有工作并设置了 Checked Prop。
您必须使用状态挂钩和 onChange 事件。
在一些帮助下,我发现这个答案有效。 https://codesandbox.io/s/sleepy-tdd-784y8
之前,我曾在Material UI 和 Formik 此处寻求帮助以获取单选按钮:
你是说单选按钮没有进入选中状态? 您没有工作并设置了 Checked Prop。 您必须使用状态挂钩和 onChange 事件。
在一些帮助下,我发现这个答案有效。 https://codesandbox.io/s/sleepy-tdd-784y8