Sha256: 9858d9dba1aa76302c783b63ad24c3e2d91102ae530db554972a2984c163279a
Contents?: true
Size: 917 Bytes
Versions: 488
Compression:
Stored size: 917 Bytes
Contents
import React, { useRef } from 'react' import { Button, Dropdown } from 'playbook-ui' const options = [ { label: "United States", value: "United States", }, { label: "Canada", value: "Canada", }, { label: "Pakistan", value: "Pakistan", } ] const DropdownClearSelection = (props) => { const dropdownRef = useRef(null) const handleReset = () => { if (dropdownRef.current) { dropdownRef.current.clearSelected() } } return ( <> <Dropdown defaultValue={options[2]} options={options} ref={dropdownRef} {...props} /> <Button marginTop="md" onClick={handleReset} text="Reset" /> </> ) } export default DropdownClearSelection
Version data entries
488 entries across 488 versions & 2 rubygems