Sha256: 5be62adae432db3e77d3da02a6d999191835d8dcb0c879fc1fc817f1b99a194b
Contents?: true
Size: 728 Bytes
Versions: 673
Compression:
Stored size: 728 Bytes
Contents
import React, { useRef } from 'react' import { Button, PhoneNumberInput } from 'playbook-ui' const PhoneNumberInputClearField = (props) => { // 1. Create a ref - this accesses the kit's input element. const ref = useRef() // 2. Use clearField() to clear the field. const handleClick = () => { ref.current.clearField() } // 3. Pass the ref to the ref prop. return ( <> <PhoneNumberInput id="clear-field" ref={ref} {...props} /> <Button onClick={handleClick} text="Clear the Input Field" /> </> ) } export default PhoneNumberInputClearField
Version data entries
673 entries across 673 versions & 2 rubygems