PricingBlog

Set page path parameter from components

  • alfred_66594-1221825909452181557

    Alfred

    1 year ago

    Hi,
    Is it possible to set path parameters from components?
  • jacobkofoed-1221827288052662372

    Jacob Kofoed

    1 year ago

    It's purposely not built in. You can use events or context workflows at page-level to update path parameters from nested components, but it would ultimately have to go through the page. Components don't really know which page they belong to at compile time 🤔 I wonder if you could make a custom action for it though. I'll try something and get back to you. Regardless, the best solution is probably to rely on the page as you can handle it centrally and validate updates.
  • alfred_66594-1221830715704868864

    Alfred

    1 year ago

    I know it's not built in Toddle's native routing, but I'm trying to achieve a concept like Next.js page routing to minimise parts of my layout UI being reloaded when navigating between leaf segments. https://nextjs.org/docs/app/building-your-application/routing/pages-and-layouts