Playground - Counter example: change version to make counter increment 2 times instead of 1
Title: Double increment upon version change Note: Possible bug in playground (not sure)
Steps:
- On Solid JS - Playground, goto counter Example,
- as soon as the HTML button is visible, change the version of Solid JS,
- Click the Counter Button to observe double increments (increment by 2)
Expected: After changing the version of SolidJS on Playground, the button should increment by 1
Confirmed as a bug. I can reproduce.
I'm going to move this one to the appropriate repo.
This is such a weird behavior. There must be some sort of cleanup that's not being properly done on the events handlers when switching versions. I'll investigate. Thanks for bringing that up to my attention.
Implementing the code for the reload button I think I found the place where this is failing, but I've yet to figure out why. Probably a race condition in the way the iframe handle code updates and deregister the previous mounted app, somewhere in there: https://github.com/solidjs/solid-playground/blob/master/src/components/preview.tsx#L152-L181