Antd 自定义按钮不触发下拉

Antd Custom button not triggering dropdown

有人可以向我解释为什么当我使用自定义按钮时下拉触发器没有被执行吗?我在其他地方使用 CustomButton 时在哪里声明 OnClick

Antd的

Dropdown传递了一个叫onClick的prop给它的childrenCustomButton,你需要把它传递给CustomButton里面的按钮:

const CustomButton = props => {
  return <Button type={props.type} onClick={props.onClick}>{props.text}</Button>;
};

Demo