You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The id of the dcc.Location component used in Pages is currently marked as non-public. However it's fairly common to see this id used in apps. Are there any issues with making the id public? What is the best practice for using dcc.Location in a Pages app?
Here are some options:
Add your own dcc.Location to the app
Use "_pages_location" in a callback
Import the id variable name:
from dash.dash import _LOCATION_ID
Create a new variable in Dash so it can be used like this:
Thanks for adding this feature request, @AnnMarieW .
I've labeled it accordingly, and assigned it as priority level 2 since it's tied to another recent PR.
I just happened upon this completely by accident and it's like @AnnMarieW read my mind again 😀 This is something I wanted to use before on Vizro and ended up being torn between making my own dcc.Location (works fine but seems kind of redundant) vs. relying on the private attribute.
So definitely 👍 from me - this would be a nice quality of life improvement for many Dash pages users I think.
Option 4 looks best to me:
from dash import page_location # or page_location_id?
# Note this matches imports for page_registry, page_container
The
id
of thedcc.Location
component used in Pages is currently marked as non-public. However it's fairly common to see this id used in apps. Are there any issues with making the id public? What is the best practice for usingdcc.Location
in a Pages app?Here are some options:
dcc.Location
to the app"_pages_location"
in a callbackMay need to update this example the docs after this is resolved
The text was updated successfully, but these errors were encountered: