Hi Plotly team
I have been seeing errors when passing components in dash properties other than children. This happens only when I pass a list of components.
I created this GitHub issue a week ago. Is this something you guys will be looking at anytime soon?
In the latest dmc alpha (0.11.0a0), I dropped @Emil ’s dash-extension solution for native dash solution to render components passed in component properties other than children but facing this issue.
opened 06:48PM - 05 Nov 22 UTC
```
dash 2.7.0
dash-core-components 2.0.0
d… ash-html-components 2.0.0
dash-table 5.0.0
dash-mantine-components 0.11.0a0
```
**Describe the bug**
When passing components in dash component properties other than `children`, an error is thrown if a list of components is passed.
```python
from dash import Dash
from dash_iconify import DashIconify
import dash_mantine_components as dmc
app = Dash(__name__)
app.layout = dmc.Divider(label=["GitHub", DashIconify(icon="fa:github")])
if __name__ == "__main__":
app.run_server(debug=True)
```
Error:
<img width="1614" alt="Screenshot 2022-11-06 at 12 10 52 AM" src="https://user-images.githubusercontent.com/91216500/200135808-1b1ea37d-4b7b-4871-9b02-e02412340600.png">
This behaviour is observed even if a single component is passed in the list:
```python
app.layout = dmc.Divider(label=[DashIconify(icon="fa:github")])
```
**Expected behavior**
No error should be displayed even when multiple components are passed.
**Screenshots**
NA
Hi @snehilvj
As of Dash 2.5 it’s possible to have components in props other than children. An examples is having components in the labels for dcc.Dropdown
Have you checked out the instructions in the docs here: Component Properties | Dash for Python Documentation | Plotly
1 Like
Hi @AnnMarieW updated my post.
According to the documentation, a list of components is okay but that’s not working for dmc for the time being.
Thanks for reporting, @snehilvj .
One of our engineers said that:
It’s a bug in the renderer components as props, it only checks the first element in the list is a component so if it’s in second it errors
Should be an easy fix, and we’ll try fix that for next Dash release.
1 Like