-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
Thank you so much for helping improve the quality of Dash!
We do our best to catch bugs during the release process, but we rely on your help to find the ones that slip through.
Describe your context
Please provide us your environment, so we can easily reproduce the issue.
I've followed this template and got it working https://github.com/plotly/dash-typescript-component-template
Describe the bug
However when i wrap one of our typescript components, e.g. out button which has this prop:
type = {
variant: "primary" | "secondary" | "tertiary"
}
Then metadata.json and propTypes it generates are wrong:
"value": [
{ "value": "'primary'", "computed": false },
{ "value": "'secondary'", "computed": false },
{ "value": "'tertiary'", "computed": false }
],
they have an extra quote around them
i guess under the hood its using this https://github.com/plotly/dash/blob/dev/dash/development/_generate_prop_types.py and using the metadata.json as source of truth, which i'm not sure where is coming from maybe react-docgen,
perhaps _generate_prop_types.py should strip out extra quotes of enums before writing the proptypes code?
def generate_enum(prop_info): |
Expected behavior
Type enum's should not have extra quotes generated
Screenshots
