eui
eui copied to clipboard
[Docs] Default props that are renamed when being destructured do not appear on props tables
Note: This applies to both EUI docs site's props tabs, and Storybook's controls pane.
Problem
Renaming props during their destructuring leads to either TS or React not correctly "seeing" and outputting their default values. Example of this:
https://github.com/elastic/eui/blob/3aea3111e16c148a6449ad988f611ad3304ec5c5/src/components/description_list/description_list.tsx#L33
Solution
- Update all instances across EUI of the above to not use variable renaming (example fix)
- Use
@defaultjsdoc notation on the Typescript type to force showing a default value (slightly worse option as it's a bit less DRY and can fall out of date, but it may be a viable option for some scenarios)
Two ways we could approach this...
- Fix the places where we rename variables
- Fix the underlying code / submit an issue to Storybook to fix it there as well