In preact@8, there is an odd issue where comopnentDidMount() gets fired aftercomponentWillEnter. I added a simple fix in this PR by just delaying the appear/leave functions, but perhaps somebody with more knowledge of preact@8 internals will know of a better solution.
Here is a test case that shows the fix, the console logs show the incorrect order of functions (enter -> mount), but after applying the patch they will show correct order (mount -> enter).
In preact@8, there is an odd issue where
comopnentDidMount()
gets fired aftercomponentWillEnter
. I added a simple fix in this PR by just delaying the appear/leave functions, but perhaps somebody with more knowledge of preact@8 internals will know of a better solution.Here is a test case that shows the fix, the console logs show the incorrect order of functions (enter -> mount), but after applying the patch they will show correct order (mount -> enter).