Sha256: ede7d606a8fa90a4a2913fcec9f56b6a4bf541b8e8ce2d44000af28c2ae1597c
Contents?: true
Size: 817 Bytes
Versions: 948
Compression:
Stored size: 817 Bytes
Contents
import React, { useState } from 'react' import { Dropdown } from 'playbook-ui' 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
948 entries across 948 versions & 2 rubygems