Skip to content

useLiveQuery with localOnlyCollection does not show changes applied during component mount #439

Description

@doepnern

When inserting into a localOnlyCollection inside a useEffect, useLiveQuery does not return the expected data immediately. However, if the insert/delete calls are wrapped in a setTimeout, the query works as expected. This also applies to changes in useLayoutEffect and directly in the component body.

Stackblitz reproduction: https://stackblitz.com/edit/react-ts-bjof6j6d?file=App.tsx

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions