Davide
Explore posts from serverscomputations created outside a `createRoot` or `render` will never be disposed
I have an onClick event that updates a store, and immediately after, it reads a derived value that depends on the store value. It works correctly, the derived value updates immediately before reading it, but since the derived state produces JSX, I am getting the above error. If I instead don't produce JSX I don't get the error. Ive been having a hard time understanding what is happening and what that error means in this context. Could somebody help me?
5 replies
Context undefined when called from a function in onClick, but not if called in component
I have a component which has a button that onClick calls a function. That function tries to access a few contexts but they are all undefined. If I try to access the contexts from the caller component they work. Is there a specific reason why this happens? Any workarounds aside from passing down all the contexts to the function every time?
19 replies