Open glenveegee opened 3 hours ago
I should add that running the same code with React has no such memory leak issue with Fragment used in the way it is in the demo repo above (https://github.com/glenveegee/preact_fragment_memleak)
@glenveegee this is probably only present in development and is an issue with prefresh https://github.com/preactjs/prefresh/issues/558 - you can try to disable prefresh in vite to reproduce that
Describe the bug When a parent component undergoes state transitions due to context changes, and it returns a fragment which bounds two or more child components that are themselves modified by changes in different parts of the context (so keying the fragment makes no sense), memory will leak and the heap will ultimately fill up and throw an error
To Reproduce
Instructions on how to reproduce and a demonstration of the memory leak are available in the following repo: https://github.com/glenveegee/preact_fragment_memleak
Steps to reproduce the behaviour:
Expected behavior