roact-spring
roact-spring copied to clipboard
Unmounting parent component during loop.delay does not disconnect spring
Steps to reproduce
return function(props)
local styles = ReactSpring.useSpring({
from = { transparency = 0 },
to = { transparency = 1 },
loop = { reset = true, delay = 2 },
})
styles.transparency:map(function(value)
print("value:", value)
return value
end)
end
unmount while the delay of 2 is active.
Expected: The spring will no longer print after 2 seconds
Actual: The spring will continue to live in the background.
This doesnt occur if the component is unmounted while the spring is running.
This is still happening in 2025 as of version 2.0.0!