refactor: omit unsued props in Rating component#768
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/dip-trasformazione-digitale/design-react-kit/32oBw1P7hysuUg2jDFtgWw1cWuog |
dej611
left a comment
There was a problem hiding this comment.
🎉 Thanks for the contribution!
The idea is good, just some comment on some readability aspect.
The failing check is just a linting issue, so just execute yarn lint --fix once updated to fix it.
src/Rating/Rating.tsx
Outdated
| interface FilteredInputProps extends Omit<InputProps, | ||
| 'bsSize' | | ||
| 'size' | | ||
| 'static' | | ||
| 'plaintext' | | ||
| 'normalized' | | ||
| 'addon' | | ||
| 'placeholder' | | ||
| 'label' | | ||
| 'value' | | ||
| 'type' | ||
| > {} | ||
|
|
||
| export interface RatingProps extends FilteredInputProps { |
There was a problem hiding this comment.
Perhaps I'd collect all the props union to filter under a type, say UnusedProps and then use the Omit<InputProps, UnusedProps> in the interface here.
It makes it a bit easier to read, in my opinion
Fixes #763
PR Checklist
masterbranch.Short description of what this resolves:
Remove ineffective props from
Ratingcomponent that were wrongly inherited from theInputPropsChanges proposed in this Pull Request: