Synphonyte / leptos-use

Collection of essential Leptos utilities inspired by React-Use / VueUse / SolidJS-USE
https://leptos-use.rs/
Apache License 2.0
309 stars 67 forks source link

Getting a signal in a throttle_fn that gets called by a resize observer causes console warnings. #87

Closed IongIer closed 6 months ago

IongIer commented 6 months ago

Selection_019

Trying to get a signal inside a throttle_fn or a throttle_fn_with_arg that is called by a resize observer leads to console warnings about accessing a signal outside of a reactive context.

I set up an example here: Example repo Component that triggers it

maccesch commented 6 months ago

Yes that is expected behavior. A throttled function is not a reactive context. Simply call .get_untracked() instead and the warning is gone.