Hi community,
the following callback should lacy load layout components. It works fine when the page first get loaded but the callback itself can return components that should trigger, but those don’t happen. Is it even possible?
thanks in advance
class LacyContainer(html.Div):
class ids:
container = lambda index: {
"index": index,
"type": "dash-router-lacy-component",
}
def __init__(self, children: Component, node_id: str, variables: Dict[str, any]):
data_prop = {"data-path": json.dumps(variables)}
super().__init__(
children, disable_n_clicks=True, id=self.ids.container(node_id), **data_prop
)
@self.app.callback(
Output(LacyContainer.ids.container(MATCH), "children"),
Input(LacyContainer.ids.container(MATCH), "id"),
Input(LacyContainer.ids.container(MATCH), "data-path"),
State(RootContainer.ids.location, "pathname"),
State(RootContainer.ids.location, "search"),
State(RootContainer.ids.state_store, "data"),
)
async def load_lacy_component(
lacy_segment_id, variables, pathname, search, loading_state
):
return LacyContainer.ids.container('possible-new-component')