Describe the bug
In the attached playground, due to the wrapConditionals compiler option, this expression
Gets turned into
_$memo(() => !!wrap())() ? n() * 2 : n()
Which means that if the prop is read from outside an owner, that memo will never be disposed
Your Example Website or App
https://playground.solidjs.com/anonymous/453940c4-6eca-4afd-9f30-00dd75aab1cb
Steps to Reproduce the Bug or Issue
- Open the playground
- Press "Increase"
- (In the console, notice that the memo has a parent owner)
- Press the second button
- (In the console, notice that the memo has NOT a parent owner)
Expected behavior
The memo should not be created if there's no owner.
Maybe a special version of createMemo() (That just calls the function when there's no owner) should be used
Screenshots or Videos
No response
Platform
- OS: Windows
- Browser: Chromium Edge
- Version: 146.0.3856.59
Additional context
I used the console.log() to detect whether the memo had a parent owner because I don't know how to turn warnings on the playground
Describe the bug
In the attached playground, due to the
wrapConditionalscompiler option, this expressionGets turned into
Which means that if the prop is read from outside an owner, that memo will never be disposed
Your Example Website or App
https://playground.solidjs.com/anonymous/453940c4-6eca-4afd-9f30-00dd75aab1cb
Steps to Reproduce the Bug or Issue
Expected behavior
The memo should not be created if there's no owner.
Maybe a special version of
createMemo()(That just calls the function when there's no owner) should be usedScreenshots or Videos
No response
Platform
Additional context
I used the
console.log()to detect whether the memo had a parent owner because I don't know how to turn warnings on the playground