Прописание типов для пропсов Flashcards

1
Q

Прописание типов для пропсов

A

Для инпута:
type DefaultInputPropsType = DetailedHTMLProps<InputHTMLAttributes<HTMLInputElement>,
HTMLInputElement></HTMLInputElement>

Для кнопки:
тип пропсов обычной кнопки, children в котором храниться название кнопки там уже описан
type DefaultButtonPropsType = DetailedHTMLProps<ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement></HTMLButtonElement>

Для чекбокса:
SuperCheckbox: React.FC<SuperCheckboxPropsType></SuperCheckboxPropsType>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly