Я создаю компонент Custom Button в React. Базовая версия компонента выглядит примерно так:
// @flow
type ButtonPropsType = {};
const Button = (props: ButtonPropsType) => {
const { children, ...rest } = props;
return <button {...rest}>{children}</button>
}
let App = () => {
return (
<div>
<Button style={{ margin: 10 }}>Sahil Kapoor</Button>
</div>
)
}
Как определить тип моего компонента Button, чтобы VS-Code знал, что мой компонент Button принимает все атрибуты обычного элемента кнопки Reactкак стиль, onClick, className и т. д.?