Skip to content

[BUG] Children prop is not always validated  #1348

Closed
@jdamiba

Description

moved from https://github.com/plotly/dash-core/issues/214

@alexcjohnson

I would expect the Dash app that follows to throw an error when the dcc.Input component tries to set children={"a dict": "is not allowed for children-input"}.

However, the error is only thrown when the html.Div component attempts to do the same.

import dash
import dash_html_components as html
import dash_core_components as dcc


app = dash.Dash(__name__)

app.layout = html.Div([
    dcc.Input(children={"a dict": "is not allowed for children-input"}),
    html.Div(children={"a dict": "is not allowed for children-div"})

])

if __name__ == '__main__':
    app.run_server(debug=True)

Error:

An object was provided as `children` instead of a component, string, or number (or list of those). Check the children property that looks something like:
{
  "a dict": "is not allowed for children-div"
}

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions