Sha256: ae35b6bcc6c2073c60ab301de8d1ea9c1451253a40445828450b8ae45a03a327
Contents?: true
Size: 722 Bytes
Versions: 627
Compression:
Stored size: 722 Bytes
Contents
import React, { useRef } from 'react' import { Button, PhoneNumberInput } from '../..' 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
627 entries across 627 versions & 2 rubygems