You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's pretty common to have event handlers that mutate the state, and in doing so, need to read the current state.
Currently, this subscribes the component and immediately re-renders it, even though in practice the DOM of the component does not depend on the value that was written
One workaround for this is to wrap the reactive object that we're about to modify in a fresh reactive with no callback, but this is not ergonomic and unintuitive
Ideally, reactives bound to components should only subscribe to keys that are read during rendering or a rendering-adjacent activity (willRender/rendered/willPatch/patched)
The text was updated successfully, but these errors were encountered:
It's pretty common to have event handlers that mutate the state, and in doing so, need to read the current state.
Currently, this subscribes the component and immediately re-renders it, even though in practice the DOM of the component does not depend on the value that was written
Playground example
One workaround for this is to wrap the reactive object that we're about to modify in a fresh reactive with no callback, but this is not ergonomic and unintuitive
Playground example
Ideally, reactives bound to components should only subscribe to keys that are read during rendering or a rendering-adjacent activity (willRender/rendered/willPatch/patched)
The text was updated successfully, but these errors were encountered: