Create New Item
×
Item Type
File
Folder
Item Name
×
Search file in folder and subfolders...
File Manager
/
wp-content
/
plugins
/
generateblocks
/
src
/
components
/
debounced-text-control
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
import { TextControl } from '@wordpress/components'; import { useEffect } from '@wordpress/element'; import useDebounceState from '../../hooks/useDebounceState'; export default function DebouncedTextControl( props ) { const [ debounceValue, setValue, value ] = useDebounceState( props?.value, 800 ); useEffect( () => { props.onChange( debounceValue ); }, [ debounceValue ] ); return ( <TextControl { ...props } value={ value } onChange={ setValue } /> ); }