Sha256: b05586f8939523aa855b5a6ff04970d64e9886dd987d555430c5362708994e68
Contents?: true
Size: 812 Bytes
Versions: 60
Compression:
Stored size: 812 Bytes
Contents
import React, { useState } from 'react' import { Dropdown } from '../../' const DropdownError = (props) => { const [selectedOption, setSelectedOption] = useState() const error = selectedOption?.value ? null : "Please make a valid selection" const options = [ { label: "United States", value: "United States", }, { label: "Canada", value: "Canada", }, { label: "Pakistan", value: "Pakistan", } ] return ( <> <Dropdown error={error} onSelect={(selectedItem) => setSelectedOption(selectedItem)} options={options} {...props} /> </> ) } export default DropdownError
Version data entries
60 entries across 60 versions & 2 rubygems