in my react app I use radio buttons with this code:
<RadioGroup name='steptype' className={css.ProcessStepRadioButtons} value={this.state.stepsData[stepNumber].stepType}
onChange={(value, event) => {
this.changeInputOptionHandlerProcessStep(value, "stepType", stepNumber)
}}>
<RadioButton label={<T value='processes.new.processStepTypeDuty'/>} value={1} />
<RadioButton label={<T value='processes.new.processStepTypeVariable'/>} value={2}/>
<RadioButton label={<T value='processes.new.processStepTypeOptioanal'/>} value={3}/>
</RadioGroup>
and this handler:
export function changeInputOptionHandlerProcessStep(value, field, step) {
this.setState((prevState) => ({
stepsData: prevState.stepsData.map((currentStep, i) => {
if (i === step) {
return {
...currentStep,
[field]: value
}
}
return currentStep
})
}), () => {
console.log("New state in ASYNC callback:", this.state.stepsData);
} );
}
State is set properly, but the radio buttons does not switch visually,
what could be the problem in this case?
thanks
UPDATE consolelog of this.state.stepsData
Update consolelog of this.state.stepsData right bevore render