Atom-Learning/components

Button: Button with type="submit' expects 'href' or 'onClick' in TS

shaneakins opened this issue · 2 comments

Button (*)

Expected Behaviour (*)

Button with type='submit' should have href and onClick as optional props since the parent form can also handle the submit

Actual Behaviour (*)

Button with type='submit' and no href or onClick shows TS error 2322:

Property 'href' is missing in type '{ children: string; type: "submit"; isLoading: boolean; "aria-label": string; }' but required in type '{ onClick?: never; href: string; }'.

Steps to reproduce (*)

Screen Shot 2021-07-30 at 10 57 00

Other information (*)

Screen Shot 2021-07-30 at 10 52 28

Please include Browser Name and version, OS and version

This issue is stale because it has been open for a year with no activity. Remove stale label or comment or this will be closed in 7 days.

This issue was closed because it has been stalled for a year with no activity.