beforeUpdated
directive hook is called as a reactive effect, which is unexpected
#3697
Labels
🔨 p3-minor-bug
Priority 3: this fixes a bug, but is an edge case that only affects very specific usage.
🐞 bug
Something isn't working
Version
3.0.11
Reproduction link
https://codepen.io/liquid-solid/pen/LYxoKEN
Steps to reproduce
What is expected?
It is expected that if a callback modifies some reactive data that does not affect rendering, it should be called once.
What is actually happening?
Actually, callback falls into recursive reactive effect loop. Also, in the local dev server (via vite) appears vue message "Error: Maximum recursive updates exceeded..."
Everything works fine with
updated
hook.Context of my bug - i need to update reactive info about element scrollTop/scrollHeight/offsetHeight, which not directly affects render function, and i tried to update it in the
beforeUpdated
directive hook.The text was updated successfully, but these errors were encountered: