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?
#computations created outside a `createRoot` or `render` will never be disposed
4 messages · Page 1 of 1 (latest)
I'm curious what the event handler looks like. Does it have a createEffect in it?
I would assume you're passing JSX around, which is not a pattern I'd encourage specially since it produces some behavior like the error you're experiencing
Yeah I figured, but what I’m wondering is why? In react it’s pretty normal to have functions return jsx and pass that around