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
While working with the dash-mantine-components library, I noticed that no helpful error messages are provided in the browser DevTools when an invalid prop is passed to a dmc component -- unlike with other Dash libraries like dash-core-components.
The issue arises because dmc components are built using TypeScript. They do not use propTypes which is how the runtime type checking is done in Dash. TypeScript is not available at runtime.
The first very helpful error message is for the dcc component (which does not use TypeScript), the second is the dmc component:
After discussing with the Plotly team, a solution could be to create a script that automatically adds propTypes to TypeScript components when running with debug=True. This script could use information from the metadata.json file, which already has details about the props and their types.
The text was updated successfully, but these errors were encountered:
gvwilson
changed the title
[BUG] No runtime type checking with TypeScript components
No runtime type checking with TypeScript components
Sep 27, 2024
While working with the
dash-mantine-components
library, I noticed that no helpful error messages are provided in the browser DevTools when an invalid prop is passed to a dmc component -- unlike with other Dash libraries likedash-core-components.
The issue arises because dmc components are built using TypeScript. They do not use
propTypes
which is how the runtime type checking is done in Dash. TypeScript is not available at runtime.Here is an example:
The first very helpful error message is for the dcc component (which does not use TypeScript), the second is the dmc component:
After discussing with the Plotly team, a solution could be to create a script that automatically adds
propTypes
to TypeScript components when running withdebug=True
. This script could use information from themetadata.json
file, which already has details about the props and their types.The text was updated successfully, but these errors were encountered: