Skip to content

fix(infiniteHits): always return valid showPrevious and showMore functions #6644

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025

Conversation

Haroenv
Copy link
Contributor

@Haroenv Haroenv commented Jun 3, 2025

Summary

We default the infinite hits showPrevious to true, but in the initial render the functions showPrevious and showMore are not yet present in the sate. This fixes that and ensures the functions are always returned.

Result

  • show more button always shows up by default (and doesn't flash)
  • ensure that showMore and showPrevious functions are always defined, even if the first render is with results (artificial for example)

Copy link

codesandbox-ci bot commented Jun 3, 2025

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 1bbdf6b:

Sandbox Source
example-instantsearch-getting-started Configuration
example-react-instantsearch-getting-started Configuration
example-react-instantsearch-next-app-dir-example Configuration
example-react-instantsearch-next-routing-example Configuration
example-vue-instantsearch-getting-started Configuration

@Haroenv Haroenv changed the title wip no flash on show previous fix(infiniteHits): always return valid showPrevious and showMore functions Jun 4, 2025
@Haroenv Haroenv marked this pull request as ready for review June 10, 2025 11:19
@Haroenv Haroenv requested review from a team, dhayab and shaejaz and removed request for a team June 10, 2025 11:19
@Haroenv
Copy link
Contributor Author

Haroenv commented Jun 10, 2025

you can ignore the netlify failure, it's fixed in the retry but the status didn't update. Seemingly cache related, not to my PR

@Haroenv Haroenv force-pushed the fix/no-flash-button branch from 6b4f31e to 1bbdf6b Compare June 10, 2025 13:03
@Haroenv Haroenv merged commit 03670aa into master Jun 10, 2025
14 checks passed
@Haroenv Haroenv deleted the fix/no-flash-button branch June 10, 2025 13:20
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.

2 participants