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

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