-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Allow dict id in target_components #3353
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
Conversation
It looks okay to me! Thanks @AnnMarieW for looking into this so quickly. We'll need to add |
Yes, it's exposed as |
Think it might be better for performance to stringify the id either in the reducer or the action. The reducer would be here:
And the action
|
@T4rk1n
@celia-lm I can do a PR to add an example to the docs after this PR is merged 🙂 |
|
@@ -753,7 +753,7 @@ export function executeCallback( | |||
const loadingOutputs = outputs.map(out => ({ | |||
path: getPath(paths, out.id), | |||
property: out.property?.split('@')[0], | |||
id: out.id | |||
id: (window as any).dash_component_api.stringifyId(out.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the renderer we can use the one from:
import {stringifyId} from './actions/dependencies';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops - of course!
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💃 Looks good.
closes #3348
This PR allows dict ids in the target_components.
CHANGELOG.md
@celia-lm
What do you think of this approach? It requires using
stringify_id
to generate a valid dictionary key. This also ensures the ID is stringified the same way Dash handles all other dict IDs.@T4rk1n I thought there was a way now to import the
stringifyId
function rather than repeating it in the component - is that true?