Skip to content

Conversation

@shortcuts
Copy link
Member

Summary

When having multi-sources, sections without results and noResults template were still rendering their header and/or footer template, which required some extra logic for the user.

Result

Sections without results and noResults template are not rendered anymore.

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 25, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7ef2e6f:

Sandbox Source
@algolia/autocomplete-example-github-repositories-custom-plugin Configuration
@algolia/autocomplete-example-instantsearch Configuration
@algolia/autocomplete-example-playground Configuration
@algolia/autocomplete-example-preview-panel-in-modal Configuration
@algolia/autocomplete-example-react-renderer Configuration
@algolia/autocomplete-example-starter-algolia Configuration
@algolia/autocomplete-example-starter Configuration
@algolia/autocomplete-example-voice-search Configuration
@algolia/autocomplete-example-vue Configuration

Copy link
Contributor

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks good!

We can remove all these checks from our examples now:

if (items.length === 0) {
return null;
}

shortcuts and others added 2 commits May 25, 2021 16:51
Co-authored-by: François Chalifour <francoischalifour@users.noreply.github.com>
Copy link
Contributor

@francoischalifour francoischalifour left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect, that'll reduce user code!

@shortcuts shortcuts merged commit 527670e into next May 25, 2021
@shortcuts shortcuts deleted the fix/render-emptySections branch May 25, 2021 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants