geist-org / geist-ui

A design system for building modern websites and applications.
https://geist-ui.dev
MIT License
4.35k stars 335 forks source link

Error after setting type as submit in Modal.Action #383

Closed leopku closed 4 years ago

leopku commented 4 years ago

Bug report 🐞

Version & Environment

Actual results (or Errors)

I got an error:

TypeScript error in ../src/components/ProjectCard.tsx(178,43):
Type '"submit"' is not assignable to type '"error" | "default" | "secondary" | "success" | "warning" | "abort" | "secondary-light" | "success-light" | "warning-light" | "error-light" | undefined'.  TS2322

    176 |               Cancel
    177 |             </Modal.Action>
  > 178 |             <Modal.Action form="msg_form" type="submit">Submit</Modal.Action>
heyAyushh commented 4 years ago

The type here you are writing is for action.

"type" here in the library is based for themes, idk if type"submit" is needed here.

unix commented 4 years ago

If you want to use native props type on the Modal.Action, please use htmlType instead of it.

<Modal.Action form="msg_form" htmlType="submit">Submit</Modal.Action>

Component Modal.Action inherits from component Button, we can see from the document of Button that htmlType is the alias of the native property.