#computations created outside a `createRoot` or `render` will never be disposed

4 messages · Page 1 of 1 (latest)

broken cove
#

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?

vernal herald
#

I'm curious what the event handler looks like. Does it have a createEffect in it?

brazen jetty
#

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

broken cove