我有一个复选框列表,但我无法在Reaction中取消选中复选框.
<input
type="checkbox"
checked={
list?.flag=== "Y" ? true : false
}
onChange={(e)=>{
e.target.value
}}
/>
我有一个复选框列表,但我无法在Reaction中取消选中复选框.
<input
type="checkbox"
checked={
list?.flag=== "Y" ? true : false
}
onChange={(e)=>{
e.target.value
}}
/>
我修好了,你可以在CodeSandBox分钟后判断
const [checkBoxList, setCheckBoxList] = useState([
{
name: "one",
flag: "Y"
},
{
name: "two",
flag: "Y"
}
]);