-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
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
[BUG] Dash 3 Components as Props #3234
Comments
Run this example:
click show and then try to update, and you will encounter the issue. It freezes everything for me. I believe the issue comes from the Icon which is set as |
From what I can tell, it happens when removing a parent element that contains one of these node components. The icon in notification is a react node which is dash iconify. And to clarify, the issue points to the selector that listens to redux for state changes. |
If it's regarding component-type parameters, I haven't been able to reproduce such issues in the fac (>=0.4.0rc1) adapted for dash 3.0. dash 3.0.0
feffery_antd_components 0.4.0rc1 import dash
from dash import html
import feffery_antd_components as fac
from feffery_dash_utils.style_utils import style
from dash.dependencies import Input, Output, State
app = dash.Dash(__name__)
app.layout = html.Div(
[
fac.AntdButton("button-demo", id="button-demo"),
html.Div(
fac.AntdButton(icon=fac.AntdIcon(icon="antd-eye")), id="button-container"
),
],
style=style(padding=50),
)
@app.callback(
Output("button-container", "children"),
Input("button-demo", "nClicks"),
State("button-container", "children"),
prevent_initial_call=True,
)
def update_icon(nClicks, icon):
return (
fac.AntdButton(icon=fac.AntdIcon(icon="antd-eye-invisible"))
if icon["props"]["icon"]["props"]["icon"] == "antd-eye"
else fac.AntdButton(icon=fac.AntdIcon(icon="antd-eye"))
)
if __name__ == "__main__":
app.run(debug=True) |
I've updated the test examples. Not sure if it's similar to the callback update scenario you described. |
@CNFeffery it would be like removing the button-container from the dash tree. For example, if I remove the icon from the component in my callback for the notification, it works. But add the icon and it breaks. |
I believe that my PR may address this: #3248 |
When components are props are unmounted, they dont unmount properly
The text was updated successfully, but these errors were encountered: