nordcloud/GNUI

Pass props into native elements

Closed this issue · 3 comments

Some components take only a few props that are required for logic inside their code, they should spread all of the remaining props that was passed into them to the native html element, you should also remove redundant native attributes/event handlers from props type interface and extend it with the one provided by React.

You can see how it should be done inside
src/components/checkbox/Checkbox.tsx
src/components/switch/Switch.tsx

Components to refactor:

  • src/components/toggle
  • src/components/text (fix types)
  • src/components/svgicon (fix types)
  • src/components/selectbutton (fix types)
  • src/components/message/Message.tsx (fix types)

hey @nowyDEV can I try to do it?

hey @nowyDEV can I try to do it?

Sure, go ahead

hi @nowyDEV, sent a PR, please review #224