react-docgen-typescript calls TypeScript which returns a comma delimited string of strings representing the possible types. This string was passed back to Playroom, which then used a regex to snip out anything that wasn't explicitly a match for essentially "(.*)".
The end result was TypeScript would return strings like:
The way TypeScript returns a comma delimited string of strings representing the possible types was very surprising! Why doesn't TypeScript return something more... structured?
This issue is particularly noticable in situations where sizing props are based on a scale:
This was an interesting one!
react-docgen-typescript
calls TypeScript which returns a comma delimited string of strings representing the possible types. This string was passed back to Playroom, which then used a regex to snip out anything that wasn't explicitly a match for essentially"(.*)"
.The end result was TypeScript would return strings like:
(Note the
... 5 more ...
)And Playroom would end up with an array of:
But when using
noErrorTruncation
, Typescript will return the full set of types:So Playroom gets the full array of possible values:
The way TypeScript returns a comma delimited string of strings representing the possible types was very surprising! Why doesn't TypeScript return something more... structured?
This issue is particularly noticable in situations where sizing props are based on a scale:
Most of the possible values would be missing due to the truncation