score:2

Accepted answer
handleOptionSelect = (option) => {
  // it is better to pass a callback if your next state
  // depends on previous state due to async nature of setState

  this.setState(state => ({
    ...state,
    questions: {
      ...state.questions, // keep answers for "non active" questions
      [state.activeQuestion]: option.value // update only active question
    }
  }))
}

Related Query

More Query from same tag