Skip to content

Conversation

@T4rk1n
Copy link
Contributor

@T4rk1n T4rk1n commented Feb 6, 2025

Add custom typing for component props, previously hardcoded for dcc.Graph.
Component libraries developer can add a file dash_prop_typing containing one or two variables:

  • custom_imports: dict[ComponentName, list[str]] import statement to be copied at the top of the component class definition.
  • custom_props: dict[ComponentName, dict[PropName, function]] for custom props. The function signature is: def generate_type(type_info, component_name, prop_name) -> str.

The module path can be changed with the dash-generate-components argument -t or --custom-typing-module.

@T4rk1n T4rk1n merged commit eba4ccf into dash-3.0 Feb 7, 2025
3 checks passed
@T4rk1n T4rk1n deleted the custom-typing-generator branch February 7, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants