QuizNot attempted
Extending native button props
1–4 to choose, Enter to submit
Show answer & explanation
Correct answer:
type Props = ComponentProps<'button'> & { isLoading?: boolean }
ComponentProps<'button'>(orComponentPropsWithoutRef<'button'>) is exactly the set of props React accepts on<button>- intersect your own and spread
...restonto the element. - Not listing by hand: incomplete and drifts from React's types.
- Not any: loses all checking.
- Not extends HTMLElement: that is the DOM node type (methods like
focus()), not JSX props.