Unused props in UUI components
- Dominant language
- TypeScript
- Stars
- 247
- Forks
- 78
- Avg merge
- 14h 27m
- Merged PRs (30d)
- 15
Description
## Now
At current moment, there are quite many unused props in UUI components. Such situation (when some props are ignored by components) might be confusing for users of the UUI library.
Notes:
- Almost all issues can be reproduced using the "Property explorer" on [UUI site](https://uui-dev.epm-ppa.projects.epam.com/).
- Full list of components/issues can be found in the attached Excel file: [tsdocs_broken_props_issues.xlsx](https://github.com/epam/UUI/files/13473317/tsdocs_broken_props_issues.xlsx)
## To Do
It's still To Be Discussed. Because there is no straightforward way to remove unused props from components' interfaces (e.g. using Omit or by removing certain interfaces from hierarchy) because it causes other issues. Possible solutions are mentioned in the attached excel file. The recommended solution is mentioned below.
## Describe the solution you'd like (optional)
It makes sense to manually mark such props in the `*.doc.tsx` files with "private" flag, e.g:
```js
doc: (doc: DocBuilder) => {
doc.markPropsAsPrivate('forwardedRef', 'isReadonly', 'isInvalid', 'isRequired');
}
```
As a result, it would be possible to highlight such props in "Property Explorer" somehow:
- show a warning icon with tooltip next to the prop name
- add possibility to hide/show private props via some toggler
- etc.
P.S. We cannot mark certain props with the [@private](https://jsdoc.app/tags-private) tag in the TS comments of the corresponding TS interface, because it won't work as expected. Namely it would affect all components including the ones which actually use the props.
Contributor guide
Assessment
This issue has not been assessed yet.