Answer the question
In order to leave comments, you need to log in
The component is not updated when passing "props"?
Good evening.
Please help, I can't figure out why.
There is a component whose state is passed to the child object
const [radioList, setRadioList] = useState([
{ id: 1, title: "input1" },
]);
......
// добавляю новый объект в состояние
const handleSetRadioList = (id, name) => {
let stateRadioList = radioList;
let obj = {};
obj["id"] = id;
obj["title"] = name;
stateRadioList.push(obj);
setRadioList(stateRadioList);
};
.......
<SelectManualRadio
handleSetRadioList={handleSetRadioList}
radioList={radioList}
/>
props.radioList.map((radio, key) =>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question