Can someone explain to me why the dropdown trigger is not being executed when I use my custom button? Where do I declare OnClick as I use CustomButton in other areas
Dropdown
of Antd passes a prop called onClick
to its children CustomButton
, and you need to pass it to the button inside CustomButton
:
const CustomButton = props => {
return <Button type={props.type} onClick={props.onClick}>{props.text}</Button>;
};