📜  react-select-search useSelect hook - Javascript 代码示例

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

代码示例1
import React from 'react';
import { useSelect } from 'react-select-search';

const CustomSelect = ({ options, value, multiple, disabled }) => {
    const [snapshot, valueProps, optionProps] = useSelect({
        options,
        value,
        multiple,
        disabled,
    });

    return (
        
{snapshot.focus && (
    {snapshot.options.map((option) => (
  • ))}
)}
); };