Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

useLiveQuery doesn't update if the query parameters change. #2651

Closed
rphlmr opened this issue Jul 18, 2024 · 0 comments · Fixed by #2652, zntb/nextjs-auth#15, zntb/nextjs-lucia-auth#20, zntb/nextjs-lucia-auth#22 or zntb/nextjs-auth#16

Comments

@rphlmr
Copy link

rphlmr commented Jul 18, 2024

useLiveQuery keeps listening to the initial query it gets on the first render.

  const todos = useLiveQuery(
    db.query.todos.findMany({
      where: between(schema.todos.created_at, from, to),
    })
  )

The from & to dates come from a parent / state.

Maybe it is because

should have query in its depency array.

Originally posted by @anstapol in #2447 (comment)

# for free to join this conversation on GitHub. Already have an account? # to comment