Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
xhluca opened this issue Apr 20, 2021 · 0 comments
Open

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

xhluca opened this issue Apr 20, 2021 · 0 comments
Labels
bug something broken dash-r Dash R applications P3 backlog

Comments

@xhluca
Copy link

xhluca commented Apr 20, 2021

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.

@xhluca xhluca added bug something broken dash dash-r Dash R applications labels Apr 20, 2021
@gvwilson gvwilson added P3 backlog and removed dash labels Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken dash-r Dash R applications P3 backlog
Projects
None yet
Development

No branches or pull requests

2 participants