SOFTENG310-Team4 / SMARTJ

SMARTJ is a web application designed to help active job seekers practice their interview skills and find available jobs in their field of study. Developed by Team 4 as part of the SOFTENG 310 course at the University of Auckland.
MIT License
0 stars 11 forks source link

Bugfix/duplicate questions #44

Closed tyin363 closed 3 months ago

tyin363 commented 3 months ago

Context

The issue arises when the "Next Question" button is clicked on the Interview Practice page, causing multiple instances of the QuestionComponent to be rendered on the screen. This bug affects the user experience by displaying multiple questions at once instead of transitioning to a new question.

Closes: #43

What Changed?

Fixed the issue where the QuestionComponent was duplicated by ensuring that only one instance of the component is rendered at a time. The key prop in the QuestionComponent was adjusted to ensure proper re-rendering of components without duplication.

How To Review

  1. Review the changes in the InterviewPractice component to ensure that the key prop is correctly used to trigger re-rendering.
  2. Check that the QuestionComponent correctly re-renders when the "Next Question" button is clicked and that no duplicate instances are displayed.

Testing

Risks

N/A

Notes

N/A

today0-o commented 3 months ago

Good job, Tony! The PR is ready to be merged. It addresses the issue of multiple QuestionComponent instances being rendered by correctly using the key prop for proper re-rendering. The solution is effective and well-tested, confirming that only one question is displayed at a time.