react native - How do I replace a webView menuItem when one of the menu is clicked? - Stack Overflow

When a menu item is selected, e.g highlight, I want to replace show colours to be selected within the s

When a menu item is selected, e.g highlight, I want to replace show colours to be selected within the same context menu. the defaultMenuItems should be replaced with the highlightMenuItems

const defaultMenuItems = [
    {
      label: "Tweet",
      key: "tweet",
    },
    {
      label: "Save",
      key: "save",
    },
    {
      label: "Highlight",
      key: "highlight",
    },
    {
      label: "Copy",
      key: "copy",
    },
  ];

  const highlightMenuItems = [
    {
      key: "red",
      label: "Red",
    },
    {
      key: "green",
      label: "Green",
    },
    {
      key: "blue",
      label: "Blue",
    },
  ];

  return (
    <WebView
      style={styles.container}
      source={{ uri: "; }}
      menuItems={defaultMenuItems}
      onCustomMenuSelection={handleCustomMenuSelection}
    />
  );

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744347404a4569768.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信