How to force my app to reload itself with new query params?

I have used the instructions Access and Manipulate the URL — Panel v1.4.2 to change my app’s query parameters on the fly.

Now, I want to force the app to reload itself at that new URL.

I tried setting pn.state.location.reload=True – didn’t help

As a hack, you can try setting reload=False and then reload=True.

import panel as pn

def handle_click(event):

pn.widgets.Button(name="Navigate to google", on_click=handle_click).servable()

It reloads the page for me. But I think that pn.state.location does not work as you could expect as a user. Feel free to file an issue on Github.

Setting reload to False and then back to True did the trick – thanks for the tip!