Running into duplicate callback outputs error. In my index.py
, there is only callback for page-content
. For reference, the structure of my app is as follows:
index.py (app layout defined here)
Tabs -
tab1.py
tab2.py
Pages -
home.py
# App Layout
app.layout = html.Div([
# header
html.Div([
dcc.Link(
href='/home',
children='Home',
style={'paddingRight': 10}
),
dcc.Location(id='url'),
html.Div(id='page-content', style={'margin-left': '2%'}),
],
className="row header"
)
])
# Render page content
@app.callback(Output("page-content", "children"),
[
Input('url', 'pathname')
]
)
def display_content(pathname):
if pathname == '/home':
return home.layout
else:
return home.layout
There is no other callback setting page-content