Wpis z mikrobloga

  • 0
@Dzieci_z_Choroszczy: wiem to alpha, już mam betę :P
Ale mały bug jest,

const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0);
const [answers, setAnswers] = useState(Array(questions.length).fill(''));
const [showResults, setShowResults] = useState(false);

const handleOptionChange = (option) => {
const updatedAnswers = [...answers];
updatedAnswers[currentQuestionIndex] = option;
setAnswers(updatedAnswers);

// Move to next question or show results
const nextQuestionIndex = currentQuestionIndex + 1;
if (nextQuestionIndex < questions.length) {
setCurrentQuestionIndex(nextQuestionIndex);
} else {
setShowResults(true); // Set showResults to true to