Использовать setState, как минимум
const MyComp = () => {
const [c, setC] = useState(0);
const [d, setD] = useState(0);
return (...)
}
class App extends React.Component {
state = {
results: []
};
handleChange = v => this.setState({
...this.state.results,
v
})
render () {
return (
<Question1 onChange={this.handleChange} />
);
}
}
class Question1 extends React.Component {
ansQ1 = () => {
this.props.onChange({ id: "q1", value: this.state.option });
}
}