✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Children in html.A not allowed?

Hello,

I’m constructing a new app at the moment and encountered something weird, possibly a small mistake I have overlooked but I can’t tell for sure:

I have this block of code in my app:

 html.Div(className = 'hover_img', 
               children = [
                                 html.A("Help",href="#",children=[html.P("Please")])
                               ]
               ),

And if I try to run the code, I get this error:

Traceback (most recent call last):
  File ".\main.py", line 147, in <module>
    html.A("Help",href="#",children=[html.P("Nice")])
  File "F:\Anaconda\lib\site-packages\dash\development\base_component.py", line 366, in wrapper
    return func(*args, **kwargs)
TypeError: __init__() got multiple values for argument 'children'

And if I remove the “children” completely in the html.A tag, the app runs without problem.

Is children not allowed in html.A? I read the documentation here and it does have a “children” component.

Did I miss anything here? Any advice is appreciated!

Okay I figured it out.

According to this post , “html.H1(children=‘Hello Dash’) is the same as html.H1(‘Hello Dash’).”

So instead of doing html.A(“Help”,href="#",children=[html.P(“Please”)])
I should pass “Help” inside the children:

html.A(href="#",children=["Help",html.P("Please")])

Hope this helps whoever stumbles upon this problem same as myself in the future.