@plastic-js/plastic 1.0.6 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/jsx-runtime.js +7 -0
package/package.json
CHANGED
package/src/jsx-runtime.js
CHANGED
|
@@ -758,8 +758,14 @@ const applyProps = (element, props = {})=> {
|
|
|
758
758
|
// owner rather than the outer effect's per-run cleanup list. Otherwise
|
|
759
759
|
// flushCleanups on the next outer re-run would tear down listeners for
|
|
760
760
|
// keys we intend to keep.
|
|
761
|
+
// Also clear alien-signals' activeSub so each per-key inner effect is
|
|
762
|
+
// a root effect, not a child of the outer key-tracking effect — child
|
|
763
|
+
// effects get auto-disposed when the parent re-runs, which would kill
|
|
764
|
+
// surviving keys' bindings.
|
|
761
765
|
const prevComp = getCurrentComputation()
|
|
766
|
+
const prevSub = getActiveSub()
|
|
762
767
|
setCurrentComputation(null)
|
|
768
|
+
setActiveSub(undefined)
|
|
763
769
|
try {
|
|
764
770
|
if (key === 'ref'){
|
|
765
771
|
const ref = props[key]
|
|
@@ -776,6 +782,7 @@ const applyProps = (element, props = {})=> {
|
|
|
776
782
|
return bindReactiveProp(element, props, key, propsIsTracked)
|
|
777
783
|
} finally {
|
|
778
784
|
setCurrentComputation(prevComp)
|
|
785
|
+
setActiveSub(prevSub)
|
|
779
786
|
}
|
|
780
787
|
}
|
|
781
788
|
|