Replies: 1 comment
-
Up, please 🙏 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Newcomer here! 👋
I just crafted a vitedge sandbox to see how it could render a REST API. It works well with pageprops, where changing route params on same route triggers pageprops, but I'm struggling making it call the API when only query string changes.
TL; DR:
/items/foo
to/items/bar
properly triggers API call to/api/items/bar
/items?page=1
to/items?page=2
doesn't trigger an API call to/api/items?page=2
as I would expectExample:
Consider the following routes:
/items
and/item/:id
.When navigating from
/item/foo
to/item/bar
,functions/props/item.js
properly gets called, returning relevant data from/api/foo
then/api/bar
, for instance.However, when navigating from
/items?page=1
to/items?page=2
, nothing happens:function/props/items.js
gets only called once and for all with/api/items?page=1
, and navigating to the same route, just changing a query param (page=2
) doesn't triggerfunction/props/items.js
handler again, althoughroute.fullPath
properly changes.Enregistrement.de.l.ecran.2022-07-14.a.16.36.47.mov
How am I supposed to handle this?
Thanks!
Ben
Beta Was this translation helpful? Give feedback.
All reactions