We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Originally posted by jkrobicki February 2, 2022 KeyError appers when I try to display components, however it works with version 0.34.0
The text was updated successfully, but these errors were encountered:
The following will reproduce the error:
toggle_type = idom.Ref() element_static_handler = StaticEventHandler() component_static_handler = StaticEventHandler() @idom.component def Root(): toggle, toggle_type.current = use_toggle(True) handler = element_static_handler.use(lambda: None) if toggle: return html.div(html.button({"onEvent": handler})) else: return html.div(SomeComponent()) @idom.component def SomeComponent(): handler = component_static_handler.use(lambda: None) return html.button({"onAnotherEvent": handler}) with idom.Layout(Root()) as layout: await layout.render() assert element_static_handler.target in layout._event_handlers assert component_static_handler.target not in layout._event_handlers toggle_type.current() await layout.render() assert element_static_handler.target not in layout._event_handlers assert component_static_handler.target in layout._event_handlers toggle_type.current() await layout.render() assert element_static_handler.target in layout._event_handlers assert component_static_handler.target not in layout._event_handlers
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Discussed in #639
Originally posted by jkrobicki February 2, 2022
KeyError appers when I try to display components, however it works with version 0.34.0
The text was updated successfully, but these errors were encountered: