solara icon indicating copy to clipboard operation
solara copied to clipboard

feat: query parameter hook

Open maartenbreddels opened this issue 1 year ago • 4 comments

Allows to use query parameters to manage state.

maartenbreddels avatar Mar 08 '23 14:03 maartenbreddels

This PR is being deployed to Railway 🚅

web: ◻️ REMOVED

railway-app[bot] avatar Mar 08 '23 14:03 railway-app[bot]

@koenvo this is what I planned for the query parameter API.

But with solara 1.7.1 you can use the more crude API:

    ....
    router = use_router()
    router.push("/some/path?count=10")

maartenbreddels avatar Mar 08 '23 14:03 maartenbreddels

@koenvo this is what I planned for the query parameter API.

But with solara 1.7.1 you can use the more crude API:

    ....
    router = use_router()
    router.push("/some/path?count=10")

Great! For me it’s most important to be able to access the query parameters instead of pushing new ones. Should that already work using use_router().search?

koenvo avatar Mar 08 '23 15:03 koenvo

Great! For me it’s most important to be able to access the query parameters instead of pushing new ones. Should that already work using use_router().search?

Indeed, that should be enough for your use case, so you don't need to wait til this branch is merged and released.

maartenbreddels avatar Mar 08 '23 15:03 maartenbreddels