-
Notifications
You must be signed in to change notification settings - Fork 36
Does not support select knobs on TypeScript string unions #72
Comments
As a related topic. I can appreciate that sometimes types will be too complex for smart-knobs to do automatically. It would be really appreciated if there was an escape hatch for that type of scenario. i.e. Some way to give smart-knobs a function that will return a knob for the prop on a component that is too complex for it to handle automatically. This will at least allow stories to be written without including the knobs into the story itself (which will result in the knob being included in doc page examples). |
@dantman I'd take a PR adding this escape hatch for sure! |
Ok, apparently strothj/react-docgen-typescript-loader#87 (comment) Perhaps smart-knobs should mention that option where it recommends use of |
I have the same problem. I use the |
I found that optional props seems to not be recognized.. eg. |
I'm using smart-knobs with TypeScript components using react-docgen-typescript-loader.
However I do not get any knobs on a component that just uses string union props like these. String props are fine so this is specific to the type handling.
The resulting __docgenInfo output by react-docgen-typescript-loader contains the following props:
It would be nice if smart-props could support the string union types for at least simple unions that can properly be represented as a
select
orradio
(e.g. a union of primitives like numbers, strings, undefined/null, and/or booleans).The text was updated successfully, but these errors were encountered: