-
-
Notifications
You must be signed in to change notification settings - Fork 463
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
base: master
Are you sure you want to change the base?
Conversation
@joetannenbaum do you think this pr makes sense? |
Hey @PedroAugustoRamalhoDuarte, thanks for the PR. I'm not sure this makes sense to me to be honest. The If it's only As a side note, I believe children are currently optional for the component, so that should already work. |
Thanks @joetannenbaum for the response. The major issue that I am trying to solve is that now I cannot send query params with WhenVisible component, and that is very useful for example for pagination. My ideia for solve this was to merge data and params props, but maybe we can think in other solution |
Thanks for the side note, maybe other PR already made this fix!! |
Why can't you send query params with the component? If the method is |
Yes, that’s exactly it. I think a better API would merge the two, as many people naturally expect that behavior is the past:
However, in the current code (modified in another PR after I created this one), I realized that the data prop is no longer necessary. We can now rely entirely on params, and it works as expected. Thank you so much for taking the time to review this PR—I truly appreciate it! |
This PR fixes #2025
Enhancements
Merge
data
andparams
props:This PR introduces a more flexible API that merges the
data
andparams
props. Now, you can pass both in a single configuration like this: