Skip to content
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

[V2] Improve WhenVisible component to merge data and params props for a more flexible API #2048

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

PedroAugustoRamalhoDuarte

This PR fixes #2025

Enhancements

  • Merge data and params props:
    This PR introduces a more flexible API that merges the data and params props. Now, you can pass both in a single configuration like this:

    <WhenVisible fallback="Loading..." data={["todos", "pagy"]} params={{
      data: {
        teste: true,
        page: pagy.page + 1,
      },
      preserveUrl: true,
    }} />
  • Make children optional in WhenVisible:
    Which enhances use cases like InfiniteScroll. Here’s an example:

    <WhenVisible fallback="Loading..." params={{
      data: {
        page: pagy.page + 1,
      },
      only: ["todos", "pagy"],
      preserveUrl: true,
    }} />

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.

[V2] Improve WhenVisible component to merge data and params props for a more flexible API
1 participant