Replies: 3 comments 6 replies
-
Could you provide a minimal example to reproduce this? That would help a lot in tracking down the bug. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Here is the code replicating the problem. Blank page appears when clicking the button. It's working on 0.34.0. from idom import html, run, use_state, component, event, vdom, EventHandler
from sanic import Sanic
from pathlib import Path
from idom.server.sanic import PerClientStateServer
@component
def show_title1(current_page, set_current_page):
def handle_click(event):
set_current_page("Epics")
return html.button({"onClick": handle_click}, "Bird")
@component
def page():
current_page, set_current_page = use_state("Users")
pages = ["Users", "Timelogs", "Epics", "Clients"]
timelogs_page = html.h1(
{"class": "text-white"}, "Timelogs Page, not implemented yet"
)
epics_page = html.h1({"class": "text-white"}, "Epics Page, not implemented yet")
# clients_page = html.h1({"class": "text-white"}, "Clients Page, not implemented yet")
print("here", current_page)
# current_page_component = html.div()
if current_page == "Users":
current_page_component = show_title1(current_page, set_current_page)
elif current_page == "Epics":
current_page_component = epics_page
elif current_page == "Timelogs":
current_page_component = timelogs_page
elif current_page == "Clients":
current_page_component = clients_page()
else:
current_page_component = html.h1(
{"class": "text-white"}, "Test Page, not implemented yet"
)
return html.div({"class": "flex w-full"}, current_page_component)
app = Sanic(__name__)
HERE = Path(__file__).parent
app.static("/static", str(HERE / "tailwind/build"))
PerClientStateServer(
page,
{
"redirect_root_to_index": False,
},
app,
)
def run():
app.run(
host="0.0.0.0",
port=8001,
workers=1,
debug=True,
)
run() and same error appears: |
Beta Was this translation helpful? Give feedback.
4 replies
-
This should be fixed in #643: |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
KeyError appers when I try to display components, however it works with version 0.34.0
Beta Was this translation helpful? Give feedback.
All reactions