Write a component that implements a custom debounce function and displays the debounced input value.
HardProblem Statement
Write a component that implements a custom debounce function and displays the debounced input value.
Sample Input
Hardcoded delay: 500ms
Sample Output
The input value updates only after the user stops typing for 500ms.
Limits
Time: 2s · Memory: 256 MB
Code Editor
Log in to submit00:00
Try your code in this preview. Submit marks it done.
import React, { useState } from "react"; const DebouncedInput = () => { return ( <div> <input type="text" placeholder="Type here..." /> <p>Debounced Value: </p> </div> ); }; export default DebouncedInput;