The selectedQuestionId is not real-time
I use the useState below. But I find the issue. The selectedQuestionId is not real-time. It stored the previous value when I passed it to component const [selectedQuestionId, setSelectedQuestionId] = useState<number>(0);