-
Notifications
You must be signed in to change notification settings - Fork 13
Description
Hi!
Your project looks really great. I'm trying to integrate it into my data project, but I ran into an issue yesterday that I couldn't solve.
Is it possible to generate links that call the router's redirect method?
I tried everything but couldn't find a clean solution. The only working approach seems to be using Streamlit buttons. Otherwise, code like this:
<nav>
<ul>
<li>
<a href={st.session_state['router'].redirect(login)}" class="navitem">Login</a>
</li>
</ul>
<nav>
causes the link to be executed automatically, making the app rerun infinitely...
As a result, when accessing the homepage, I'm automatically redirected to the login page.
(By the way, I stored the router object in session_state. Is that a good approach?)
I tried:
- Adding JavaScript with event.preventDefault() to prevent the page from reloading
- Replacing the <a> link with a button and handling the click event with JavaScript
- Many, many other things...
So, I'm open to any ideas that could shed some light on this issue.
If there's no way to achieve this, could you explain how navigation is supposed to be handled?
Thank you so much!
Best regards