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
Thanks for the question. Since the reactivity rule can't know the implementation of your custom hooks, it should be permissive about calling it with signals. Currently it looks for arguments that are inline functions and allows reactivity there, but it misses anything else like in your case.
I think I'll call this a bug, because your code looks perfectly valid--the rule needs to be more flexible around custom hooks. Look for a fix in the next release!
const[baz,setBaz]=createSignal(0);functiongetBar(): unknown{returnprops.params.bar;}// with or without this `createState` function we get the reactivity warningconststate=createState({getfoo(){// okreturnprops.params.foo;},getbar(){// okreturngetBar();},getbaz(){// reactity warningreturnbaz();}});conststate={getfoo(){// okreturnprops.params.foo;},getbar(){// okreturngetBar();},getbaz(){// reactity warningreturnbaz();}};
Your Question
How can we make the 2nd pattern valid wrt reactivity rule?
The text was updated successfully, but these errors were encountered: