Skip to content

v3.0.0

Latest
Compare
Choose a tag to compare
@huyenltnguyen huyenltnguyen released this 18 Oct 18:55
· 15 commits to main since this release
1a27bd5

What's Changed

Breaking Changes

  • useQuiz now requires a passingGrade prop
  • The value of correctAnswerCount returned from useQuiz can be undefined instead of always being a number. The undefined value indicates that the quiz has not been validated (the validateAnswer function hasn't been called)
  • QuizQuestion no longer accepts a validation prop. The prop is now folded into the QuizQuestion's answers prop.
    • Old:
      <QuizQuestion
        question="Lorem ipsum"
        answers={[
          { label: "Option 1", value: 1 },
          { label: "Option 2", value: 2 },
        ]}
        selectedAnswer={1}
        validation={{ state: "correct", message: "Correct!" }}
      />
    • New:
      <QuizQuestion
        question="Lorem ipsum"
        answers={[
          { 
      	  label: "Option 1",
      	  value: 1,
      	  validation: { state: "correct", message: "Correct!" }
      	},
          { label: "Option 2", value: 2 },
        ]}
        selectedAnswer={1}
      />

Full Changelog: v2.3.1...v3.0.0