const [ answers, setAnswers ] = useState(Array(props.questions.length).fill(null));
const updateAnswer = (questionIndex, answer) =>
setAnswers(answers.map((n, i) => i === questionIndex ? answer : n));
<input
type="radio"
value={i}
checked={props.answer === i}
onChange={onChange}
/>