通过数组传递Redux操作创建者?

时间:2020-04-14 09:02:55

标签: react-redux

我有一系列菜单链接,我可以将它们传递给多个组件以供使用:

const menuLinks: { text: string; Icon: any; press: any }[] = [
  {
    text: "Contact",
    Icon: IconContact,
    press: () => console.log("contact pressed"),
  },
  { 
    text: "About", 
    Icon: IconAbout, 
    press: () => console.log("about pressed") },
];

如何使press属性调度Redux操作?

0 个答案:

没有答案