📌  相关文章
📜  使用自定义选项对选择做出反应 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:43.191000             🧑  作者: Mango

代码示例1
import React from "react";
import ReactDOM from "react-dom";
import Select from "react-select";

const options = [
  { value: "Abe", label: "Abe", customAbbreviation: "A" },
  { value: "John", label: "John", customAbbreviation: "J" },
  { value: "Dustin", label: "Dustin", customAbbreviation: "D" }
];

const formatOptionLabel = ({ value, label, customAbbreviation }) => (
  
{label}
{customAbbreviation}
); const CustomControl = () => (