What is the best way to handle updates after a user stops typing? : <p>I have a child component form and I'm passing and updateDraft function once the user stops typing. Is this the best way to handle it? </p>

<pre><code>const updateTimer = (props) =&gt; {
    if (this.timeout) clearTimeout(this.timeout)
    this.timeout = setTimeout(() =&gt; {
        props.updateDraft
    }, 5000)
};

    const Form = (props) =&gt; {

        return(
            &lt;Input type="text" 
    onKeyUp={updateTimer(props)} 
    onChange={props.onChange} 
    /&gt;
        )

    }
</code></pre>
