Skip to content

Add ExternalWrapper to dash_component_api #3170

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

Merged
merged 1 commit into from
Feb 18, 2025
Merged

Add ExternalWrapper to dash_component_api #3170

merged 1 commit into from
Feb 18, 2025

Conversation

T4rk1n
Copy link
Contributor

@T4rk1n T4rk1n commented Feb 17, 2025

Add new exposed component ExternalWrapper to window.dash_component_api.

It has the props:

  • componentPath path to the component in the store. Should use the parent path to create a new path, [...parentPath, "external"]
  • componentType string type of the component to hydrate.
  • componentNamespace string of the namespace where the component is located. example dash_core_components, dash_table. The namespace must have been loaded before use.
  • The rest of the props are given as extra props to the wrapper, allowing the component author to control the props of the component.

Intended usage in libraries to reuse dash components without them being present in the original layout.

@gvwilson
Copy link
Contributor

I'm happy to approve this so that it can be merged but will be doing so on faith - I don't understand the Dash code well enough to do a proper review.

@T4rk1n T4rk1n merged commit acd2a2a into dash-3.0 Feb 18, 2025
3 checks passed
@T4rk1n T4rk1n deleted the api-render branch February 18, 2025 13:31
@AnnMarieW
Copy link
Collaborator

AnnMarieW commented Feb 18, 2025

@T4rk1n

Can you say more about this use case for this?

What if the component is not a simple component but also has components in children or other props?

Is this a replacement for the renderDashComponents function used in dmc?

@T4rk1n
Copy link
Contributor Author

T4rk1n commented Feb 18, 2025

Is this a replacement for the renderDashComponents function used in dmc?

Yes this is intended for this purpose, rendering components out of the layout tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants