preactjs / preact-www

:book: Preact documentation website.
https://preactjs.com
MIT License
358 stars 500 forks source link

fix: Ensure the 'Solve' button in the tutorial works #1171

Closed rschristian closed 2 months ago

rschristian commented 2 months ago

re: https://x.com/danvitoriano/status/1815851188643926179

Missed in the CodeMirror 6 migration -- we're essentially now using a slug prop to determine when CodeMirror needs to swap out the code content vs letting its internal state continue to handle changes. As such, this PR adds a ?solved redirect to address this.

Keep in mind that solutionCtx.solved can have additional requirements, like having the user click a button to test their new event handler, so we can't reuse it.