Из приведенной ниже функции видно, что у нее есть проблема в паре ключ-значение
updateState = e => {
// [input] input here was neither declared nor initialized with any value
this.setState({ [input]: e.target.value });
};
и измените
UserForm. js file
state = {
step: 1,
values: [
{
section: "summary",
answers:
{
answerA: 1,
answerB: 13,
answerC: 6
}
},
{
section: "players",
answers:
{
answerE: 15,
answerF: 132,
answerG: 63
}
}
]
}
switch (step) {
default:
return (
<Start />
);
}
К этому
UserForm. js file
state = {
step: 1,
values: [
{
section: "summary",
answers:
{
answerA: 1,
answerB: 13,
answerC: 6
}
},
{
section: "players",
answers:
{
answerE: 15,
answerF: 132,
answerG: 63
}
}
]
}
updateState =(e,input) => { // <=== changes
this.setState({ [input]: e.target.value });
};
switch (step) {
default:
return (
<Start update={this.updateState}/> // changes
);
}