Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

react native custom debounce input

import React, { useCallback } from "react";
import { debounce } from "lodash";

const handler = useCallback(debounce(someFunction, 2000), []);

const onChange = (event) => {
    // perform any event related action here

    handler();
 };
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #react #native #custom #debounce #input
ADD COMMENT
Topic
Name
7+3 =