Skip to content

Use app.get_relative_path instead of hardcoded app name for dcc.Link #615

@xhluca

Description

@xhluca

Example 1:

def get_menu():
menu = html.Div(
[
dcc.Link(
"Overview",
href="/dash-financial-report/overview",
className="tab first",
),
dcc.Link(
"Price Performance",
href="/dash-financial-report/price-performance",
className="tab",
),
dcc.Link(
"Portfolio & Management",
href="/dash-financial-report/portfolio-management",
className="tab",
),
dcc.Link(
"Fees & Minimums", href="/dash-financial-report/fees", className="tab"
),
dcc.Link(
"Distributions",
href="/dash-financial-report/distributions",
className="tab",
),
dcc.Link(
"News & Reviews",
href="/dash-financial-report/news-and-reviews",
className="tab",
),
],
className="row all-tabs",
)
return menu

Example 2:

https://github.com/plotly/dash-sample-apps/blob/28264a906ba86a2f1a7a15b22d56163cabd70370/apps/dash-peaky-finders/peaky_app.py

The moment the name of the app changes, they will likely break. They should be using app.get_relative_path("/my-route") instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3backlogbugsomething brokendash-rDash R applications

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions