Skip to content

How to show the initial data? (empty state) #1143

Closed
@valeriu-dev

Description

@valeriu-dev

We use our own API to get completions.
The task is to display last searches and last viewed users when search query is empty.
tried to call this.getSources with empty query, in initial onStateChange, but unsuccessfully

onStateChange({ state, setQuery, setIsOpen, refresh }) {
        if (!state.query) {
            this.getSources({ query: '' })
        }
    }

our API is requested successfully but completions aren't show

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