{"id":1659,"date":"2024-07-08T12:48:33","date_gmt":"2024-07-08T12:48:33","guid":{"rendered":"https:\/\/www.vibidsoft.com\/blog\/?p=1659"},"modified":"2026-11-24T07:37:00","modified_gmt":"2026-11-24T07:37:00","slug":"how-to-debounce-throttle-a-callback-with-react-hooks","status":"publish","type":"post","link":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/","title":{"rendered":"How to Debounce and Throttle a Callback with React Hooks"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">To debounce or throttle a callback in React, create the debounced function once per component (with <code>useMemo<\/code> or a custom hook), keep the latest callback in a ref so the timer never calls stale code, and cancel any pending timer when the component unmounts. Debounce waits until events stop (search boxes, autosave); throttle runs at most once per interval (scroll, resize, drag).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The most common bug is creating a new debounced function on every render, which resets the timer each time and means nothing is ever debounced. This guide gives you two small hooks, <code>useDebouncedCallback<\/code> and <code>useThrottledCallback<\/code>, with <code>cancel<\/code> and <code>flush<\/code>, a debounced search example, notes on React 19 and Strict Mode, and when to use <code>useDeferredValue<\/code>, <code>useTransition<\/code> or a library instead. The examples use TypeScript and React 19.3, the current release at the time of writing (see <a href=\"https:\/\/react.dev\/versions\" target=\"_blank\" rel=\"noreferrer noopener\">React versions<\/a>); they also work in React 18.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Debounce vs throttle: which one do you need?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Both limit how often a function runs, but they answer different questions. Debounce asks &#8220;has the user stopped?&#8221;; throttle asks &#8220;has enough time passed since the last run?&#8221;<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Technique<\/th><th>What it does<\/th><th>Use it for<\/th><\/tr><\/thead><tbody><tr><td>Debounce<\/td><td>Runs once, after events stop for <em>n<\/em> milliseconds<\/td><td>Search-as-you-type, autosave, form validation, window resize end<\/td><\/tr><tr><td>Throttle<\/td><td>Runs at most once every <em>n<\/em> milliseconds while events continue<\/td><td>Scroll position, infinite scroll, drag, mouse move, analytics pings<\/td><\/tr><tr><td><code>useDeferredValue<\/code><\/td><td>Lets React render a slow part of the UI with a slightly older value, interruptibly<\/td><td>Filtering or rendering a large list in the browser<\/td><\/tr><tr><td><code>useTransition<\/code><\/td><td>Marks a state update as non-urgent so input stays responsive<\/td><td>Switching tabs or views that render heavy content<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">A simple rule: if the expensive work is a network request or another side effect, debounce or throttle it. If the expensive work is rendering, start with <code>useDeferredValue<\/code> or <code>useTransition<\/code>, which are covered further down.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why the naive approach fails<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Each render of a function component creates new local functions. If you write <code>const debounced = debounce(search, 300)<\/code> directly in the component body, every keystroke causes a render, every render creates a new debounced function with its own timer, and every call goes through a fresh timer. You get one request per keystroke, just delayed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Wrapping the callback in <code>useCallback<\/code> with the callback and delay as dependencies (as many older tutorials do) has a quieter version of the same problem: whenever the parent passes a new callback, the hook returns a new function, and any code that compares it (effect dependencies, <code>memo<\/code> children) re-runs. A correct hook needs three things:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>A stable function identity<\/strong> that survives re-renders, created with <code>useMemo<\/code> and recreated only when the delay changes.<\/li>\n\n\n\n<li><strong>A ref to the latest callback<\/strong>, so the timer always calls current code with current props and state, without restarting.<\/li>\n\n\n\n<li><strong>Cleanup<\/strong> that cancels the pending timer when the component unmounts, so you never update state on an unmounted component or fire a request nobody needs.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">A correct useDebouncedCallback hook<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This hook returns a debounced function with <code>cancel()<\/code>, <code>flush()<\/code> and <code>isPending()<\/code> methods, the same shape as the popular libraries:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { useEffect, useLayoutEffect, useMemo, useRef } from 'react';\n\ntype AnyFn = (...args: any[]) =&gt; void;\n\nexport function useDebouncedCallback&lt;T extends AnyFn&gt;(callback: T, delay: number) {\n  const callbackRef = useRef(callback);\n  const timerRef = useRef&lt;ReturnType&lt;typeof setTimeout&gt; | null&gt;(null);\n  const argsRef = useRef&lt;Parameters&lt;T&gt; | null&gt;(null);\n\n  \/\/ Keep the latest callback without restarting the timer\n  useLayoutEffect(() =&gt; {\n    callbackRef.current = callback;\n  });\n\n  const debounced = useMemo(() =&gt; {\n    const cancel = () =&gt; {\n      if (timerRef.current !== null) clearTimeout(timerRef.current);\n      timerRef.current = null;\n      argsRef.current = null;\n    };\n\n    \/\/ Run the pending call now (for example before navigating away)\n    const flush = () =&gt; {\n      if (timerRef.current === null || argsRef.current === null) return;\n      const args = argsRef.current;\n      cancel();\n      callbackRef.current(...args);\n    };\n\n    const fn = (...args: Parameters&lt;T&gt;) =&gt; {\n      argsRef.current = args;\n      if (timerRef.current !== null) clearTimeout(timerRef.current);\n      timerRef.current = setTimeout(flush, delay);\n    };\n\n    return Object.assign(fn, { cancel, flush, isPending: () =&gt; timerRef.current !== null });\n  }, [delay]);\n\n  \/\/ Cancel the pending call on unmount (and when the delay changes)\n  useEffect(() =&gt; debounced.cancel, [debounced]);\n\n  return debounced;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The callback ref is updated in <code>useLayoutEffect<\/code> rather than during render, because React&#8217;s rules say you should not write to <code>ref.current<\/code> while rendering (see the <a href=\"https:\/\/react.dev\/reference\/react\/useRef\" target=\"_blank\" rel=\"noreferrer noopener\">useRef reference<\/a>). Layout effects run after the commit and before the browser paints, so the ref is current before the user can trigger another event.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">A correct useThrottledCallback hook<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">This throttle runs immediately on the first call (leading edge), ignores calls inside the window, and then runs once more at the end of the window with the latest arguments (trailing edge), so the final scroll or drag position is never lost:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export function useThrottledCallback&lt;T extends AnyFn&gt;(callback: T, wait: number) {\n  const callbackRef = useRef(callback);\n  const lastRunRef = useRef(0);\n  const timerRef = useRef&lt;ReturnType&lt;typeof setTimeout&gt; | null&gt;(null);\n  const argsRef = useRef&lt;Parameters&lt;T&gt; | null&gt;(null);\n\n  useLayoutEffect(() =&gt; {\n    callbackRef.current = callback;\n  });\n\n  const throttled = useMemo(() =&gt; {\n    const run = () =&gt; {\n      timerRef.current = null;\n      lastRunRef.current = Date.now();\n      const args = argsRef.current;\n      argsRef.current = null;\n      if (args) callbackRef.current(...args);\n    };\n\n    const cancel = () =&gt; {\n      if (timerRef.current !== null) clearTimeout(timerRef.current);\n      timerRef.current = null;\n      argsRef.current = null;\n    };\n\n    const flush = () =&gt; {\n      if (timerRef.current === null) return;\n      clearTimeout(timerRef.current);\n      run();\n    };\n\n    const fn = (...args: Parameters&lt;T&gt;) =&gt; {\n      argsRef.current = args;\n      const remaining = wait - (Date.now() - lastRunRef.current);\n      if (remaining &lt;= 0) {\n        if (timerRef.current !== null) clearTimeout(timerRef.current);\n        run(); \/\/ leading edge\n      } else if (timerRef.current === null) {\n        timerRef.current = setTimeout(run, remaining); \/\/ trailing edge\n      }\n    };\n\n    return Object.assign(fn, { cancel, flush });\n  }, [wait]);\n\n  useEffect(() =&gt; throttled.cancel, [throttled]);\n\n  return throttled;\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use it for continuous events. Because the returned function is stable, the effect below subscribes once instead of re-subscribing on every render:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function ScrollProgress() {\n  const [progress, setProgress] = useState(0);\n\n  const onScroll = useThrottledCallback(() =&gt; {\n    const max = document.documentElement.scrollHeight - window.innerHeight;\n    setProgress(max &gt; 0 ? window.scrollY \/ max : 0);\n  }, 100);\n\n  useEffect(() =&gt; {\n    window.addEventListener('scroll', onScroll, { passive: true });\n    return () =&gt; window.removeEventListener('scroll', onScroll);\n  }, [onScroll]);\n\n  return &lt;progress value={progress} max={1} \/&gt;;\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Example: a debounced search box that handles stale responses<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Debouncing reduces the number of requests, but it does not stop an older, slower response from arriving after a newer one. Pair the debounce with an <code>AbortController<\/code> so only the latest request can update state:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>type Product = { id: string; name: string };\n\nfunction ProductSearch() {\n  const [query, setQuery] = useState('');\n  const [results, setResults] = useState&lt;Product[]&gt;([]);\n  const controllerRef = useRef&lt;AbortController | null&gt;(null);\n\n  const search = useDebouncedCallback(async (q: string) =&gt; {\n    controllerRef.current?.abort();\n    if (!q.trim()) {\n      setResults([]);\n      return;\n    }\n    const controller = new AbortController();\n    controllerRef.current = controller;\n    try {\n      const res = await fetch(`\/api\/search?q=${encodeURIComponent(q)}`, {\n        signal: controller.signal,\n      });\n      setResults(await res.json());\n    } catch (err) {\n      if ((err as Error).name !== 'AbortError') console.error(err);\n    }\n  }, 300);\n\n  \/\/ Abort an in-flight request on unmount\n  useEffect(() =&gt; () =&gt; controllerRef.current?.abort(), []);\n\n  return (\n    &lt;&gt;\n      &lt;input\n        value={query}\n        onChange={(e) =&gt; {\n          setQuery(e.target.value); \/\/ the input stays instant\n          search(e.target.value);   \/\/ the request is debounced\n        }}\n        placeholder=\"Search products\"\n      \/&gt;\n      &lt;ul&gt;\n        {results.map((p) =&gt; &lt;li key={p.id}&gt;{p.name}&lt;\/li&gt;)}\n      &lt;\/ul&gt;\n    &lt;\/&gt;\n  );\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Two details matter. The input&#8217;s own state updates on every keystroke, so typing never feels laggy; only the request is delayed. And the value is passed to the debounced function rather than the event object, which keeps the callback independent of React&#8217;s event system. Between 250 and 500 ms is a common delay for search; tune it with real users.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Alternative: debounce the value instead of the callback<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you would rather keep the fetch inside an effect (or in a data library such as TanStack Query keyed by the search term), debounce the value. This version is short and naturally safe in Strict Mode because the effect cleans up its own timer:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function useDebouncedValue&lt;T&gt;(value: T, delay: number): T {\n  const [debounced, setDebounced] = useState(value);\n  useEffect(() =&gt; {\n    const id = setTimeout(() =&gt; setDebounced(value), delay);\n    return () =&gt; clearTimeout(id);\n  }, [value, delay]);\n  return debounced;\n}\n\n\/\/ const debouncedQuery = useDebouncedValue(query, 300);\n\/\/ useEffect(() =&gt; { \/* fetch with debouncedQuery *\/ }, [debouncedQuery]);<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">How React 19 and Strict Mode affect debounced callbacks<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In development, <a href=\"https:\/\/react.dev\/reference\/react\/StrictMode\" target=\"_blank\" rel=\"noreferrer noopener\">Strict Mode<\/a> renders components twice and runs one extra setup and cleanup cycle for every Effect. That is why both hooks above cancel in an effect cleanup: the extra cycle simply cancels a timer that does not exist yet, and nothing leaks. If a debounce hook has no cleanup, Strict Mode is often where you first see duplicate requests or warnings.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Memoised values are reused in the double render.<\/strong> The <a href=\"https:\/\/react.dev\/blog\/2024\/04\/25\/react-19-upgrade-guide\" target=\"_blank\" rel=\"noreferrer noopener\">React 19 upgrade guide<\/a> notes that <code>useMemo<\/code> and <code>useCallback<\/code> reuse the first render&#8217;s result during Strict Mode&#8217;s second render, so the debounced function is not created twice.<\/li>\n\n\n\n<li><strong>Do not treat <code>useMemo<\/code> as a guarantee.<\/strong> React may discard memoised values in some cases. The hooks above keep the timer and arguments in refs and cancel the old instance in cleanup, so a recreated function still behaves correctly.<\/li>\n\n\n\n<li><strong>Hydration now double-invokes Effects too.<\/strong> React 19.3 runs Strict Mode&#8217;s extra Effect cycle during hydration, matching client-rendered roots (see the <a href=\"https:\/\/react.dev\/blog\/2026\/09\/09\/react-19-3\" target=\"_blank\" rel=\"noreferrer noopener\">React 19.3 post<\/a>). Server-rendered apps that skipped this check before may now surface missing cleanups.<\/li>\n\n\n\n<li><strong><code>useEffectEvent<\/code> is not a replacement here.<\/strong> It shipped in React 19.2 (see the <a href=\"https:\/\/react.dev\/blog\/2025\/10\/01\/react-19-2\" target=\"_blank\" rel=\"noreferrer noopener\">React 19.2 post<\/a>), but the <a href=\"https:\/\/react.dev\/reference\/react\/useEffectEvent\" target=\"_blank\" rel=\"noreferrer noopener\">docs<\/a> say an Effect Event may only be called from inside Effects, not from event handlers or children. A debounced <code>onChange<\/code> handler still needs the ref pattern.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">When to use useDeferredValue or useTransition instead<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If typing feels slow because a large list re-renders on each keystroke, a debounce only moves the freeze to later. The <a href=\"https:\/\/react.dev\/reference\/react\/useDeferredValue\" target=\"_blank\" rel=\"noreferrer noopener\">useDeferredValue documentation<\/a> explains why: deferred re-renders need no fixed delay, adapt to the device, and are interruptible, while debounced and throttled renders still block once they start. The docs also say debouncing and throttling remain useful when the work does not happen during rendering, such as limiting network requests, and that you can combine them.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function FilterableList({ items }: { items: Item[] }) {\n  const [text, setText] = useState('');\n  const deferredText = useDeferredValue(text);\n  const isStale = text !== deferredText;\n\n  return (\n    &lt;&gt;\n      &lt;input value={text} onChange={(e) =&gt; setText(e.target.value)} \/&gt;\n      &lt;div className={isStale ? 'dimmed' : undefined}&gt;\n        &lt;SlowList items={items} filter={deferredText} \/&gt;\n      &lt;\/div&gt;\n    &lt;\/&gt;\n  );\n}\n\/\/ Wrap SlowList in memo() so it only re-renders when deferredText changes.<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use <a href=\"https:\/\/react.dev\/reference\/react\/useTransition\" target=\"_blank\" rel=\"noreferrer noopener\">useTransition<\/a> when you own the state update and want to mark it as non-urgent, for example switching to a tab that renders a heavy chart. For a search box that both filters local data and calls an API, a common combination is <code>useDeferredValue<\/code> for the list and a debounced callback for the request.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Library options: use-debounce and lodash<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Writing your own hook is fine for a few call sites, but a maintained library covers edge cases such as <code>maxWait<\/code> and leading-only behaviour.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Option<\/th><th>What you get<\/th><th>Notes<\/th><\/tr><\/thead><tbody><tr><td><a href=\"https:\/\/github.com\/xnimorz\/use-debounce\" target=\"_blank\" rel=\"noreferrer noopener\">use-debounce<\/a><\/td><td><code>useDebounce<\/code> (value), <code>useDebouncedCallback<\/code> and <code>useThrottledCallback<\/code>, with <code>cancel<\/code>, <code>flush<\/code> and <code>isPending<\/code><\/td><td>Hook-first, small; options <code>leading<\/code>, <code>trailing<\/code> and <code>maxWait<\/code>. Version 10.1 at the time of writing<\/td><\/tr><tr><td><a href=\"https:\/\/lodash.com\/docs#debounce\" target=\"_blank\" rel=\"noreferrer noopener\">lodash debounce and throttle<\/a><\/td><td>Battle-tested functions with <code>cancel<\/code> and <code>flush<\/code><\/td><td>Not React-aware: create once with <code>useMemo<\/code>, call the latest callback through a ref and cancel on unmount<\/td><\/tr><tr><td>Your own hook (above)<\/td><td>Exactly the behaviour you need, no dependency<\/td><td>You maintain and test it<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">With use-debounce, the search example becomes:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { useDebouncedCallback } from 'use-debounce';\n\nconst search = useDebouncedCallback((q: string) =&gt; runSearch(q), 300, { maxWait: 1000 });\n\/\/ search.cancel(), search.flush() and search.isPending() are available<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you use lodash, import the single function (<code>import debounce from 'lodash\/debounce'<\/code> or the <code>lodash-es<\/code> build) so your bundler can drop the rest. The standalone <code>lodash.debounce<\/code> package still works but has not been republished since 2016, so the main <code>lodash<\/code> package is the better-maintained source.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common mistakes checklist<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Calling <code>debounce()<\/code> directly in the component body, which creates a new timer every render.<\/li>\n\n\n\n<li>Putting the callback in the hook&#8217;s dependency list, which recreates the debounced function whenever the parent re-renders.<\/li>\n\n\n\n<li>No cleanup on unmount, which leads to state updates on unmounted components and wasted requests.<\/li>\n\n\n\n<li>Debouncing the input&#8217;s own value, which makes typing feel broken. Keep the input instant and debounce the side effect.<\/li>\n\n\n\n<li>Ignoring out-of-order responses. Use <code>AbortController<\/code> or a request ID.<\/li>\n\n\n\n<li>Using debounce to hide slow rendering. Profile first, then try <code>useDeferredValue<\/code>, <code>memo<\/code> or list virtualisation.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">What is the difference between debounce and throttle in React?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Debounce runs a function once, after events have stopped for a set time. Throttle runs it at most once per interval while events keep firing. Use debounce for search and autosave, and throttle for scroll, resize and drag.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why is my debounced function not working in React?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Usually because a new debounced function is created on every render, so each call gets its own timer. Create it once with <code>useMemo<\/code> or a custom hook, and read the latest callback from a ref.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Should I use useCallback or useMemo to debounce?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><code>useMemo(() =&gt; debounce(fn, delay), [delay])<\/code> expresses the intent best, because you are memoising the result of calling <code>debounce<\/code>. Pair it with a ref to the latest callback and a cleanup that cancels on unmount, or use a library hook that does this for you.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Does React Strict Mode break debounce?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No, but it exposes missing cleanup. In development, Strict Mode runs an extra setup and cleanup for every Effect. If your hook cancels its timer in cleanup, behaviour is correct in both development and production.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Is useDeferredValue better than debounce?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">For slow rendering, usually yes: it needs no fixed delay and is interruptible. For network requests and other side effects, debounce or throttle is still the right tool. Many search screens use both.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Need a faster, more reliable React front end?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Vibidsoft builds and fixes React and Next.js applications as fixed-price work, never by the hour. A fixed-price assessment (from $1,500, credited to the build) profiles your slow screens, request patterns and re-renders and gives you a written fix list with a fixed quote. Larger work runs as milestone projects with acceptance criteria, or as an outcome pod from $4,000\/month for ongoing product work.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">See our <a href=\"https:\/\/www.vibidsoft.com\/react-development\">React development services<\/a>, browse more <a href=\"https:\/\/www.vibidsoft.com\/blog\/topic\/engineering\/\">engineering guides<\/a>, or <a href=\"https:\/\/bookings.cloud.microsoft\/bookwithme\/user\/2c77b9a11fbb48169feba028f972d1d2@vibidsoft.com\/meetingtype\/1XgnwYxUJ0aAdF5zsoM-Yw2?anonymous&amp;ismsaljsauthenabled\" target=\"_blank\" rel=\"noopener\" data-vs-booking=\"blog-post-1659\">book a free 20-minute call<\/a>.<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>To debounce or throttle a callback in React, create the debounced function once per component (with useMemo or a custom hook), keep the latest\u2026<\/p>\n","protected":false},"author":7,"featured_media":3300,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"vs_takeaways":"Create the debounced or throttled function once per component, keep the latest callback in a ref, and cancel the timer on unmount.\nDebounce waits until events stop (search, autosave); throttle runs at most once per interval (scroll, resize, drag).\nReact Strict Mode runs an extra effect setup and cleanup in development, so hooks without cleanup show duplicate calls.\nFor slow rendering, use useDeferredValue or useTransition; keep debounce and throttle for network requests and other side effects.","footnotes":""},"categories":[156],"tags":[1920,1928,1919,1916,1918,1917,1926,1921,1929,1925,1930,1923,1927,1924,1922],"class_list":["post-1659","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react-native","tag-api-calls","tag-callback","tag-custom-hooks","tag-debounce","tag-event-handling","tag-function-throttling","tag-input-debouncing","tag-react-hooks","tag-react-performance","tag-react-tutorial","tag-responsive-ui","tag-search-optimization","tag-throttle","tag-usedebounce","tag-usethrottle"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.5.1 - aioseo.com -->\n\t<meta name=\"description\" content=\"Correct useDebouncedCallback and useThrottledCallback hooks with cancel and flush, a debounced search, React 19 Strict Mode notes and useDeferredValue.\" \/>\n\t<meta name=\"robots\" content=\"max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n\t<meta name=\"author\" content=\"Vibidsoft Engineering Team\"\/>\n\t<meta name=\"p:domain_verify\" content=\"147eaec3c09ba1af5e17b00fa12931da\" \/>\n\t<meta name=\"yandex-verification\" content=\"71876bdda9be7264\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Vibidsoft | Website and Mobile Apps Development Company\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"How to Debounce and Throttle a Callback with React Hooks\" \/>\n\t\t<meta property=\"og:description\" content=\"Correct useDebouncedCallback and useThrottledCallback hooks with cancel and flush, a debounced search, React 19 Strict Mode notes and useDeferredValue.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-07-08T12:48:33+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2026-11-24T07:37:00+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/vibidsoft\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/www.vibidsoft.com\/blog\/wp-content\/uploads\/2026\/11\/vibidsoft-blog-1659.jpg\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:site\" content=\"@vibidsoft\" \/>\n\t\t<meta name=\"twitter:title\" content=\"How to Debounce and Throttle a Callback with React Hooks\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Correct useDebouncedCallback and useThrottledCallback hooks with cancel and flush, a debounced search, React 19 Strict Mode notes and useDeferredValue.\" \/>\n\t\t<meta name=\"twitter:creator\" content=\"@vibidsoft\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/www.vibidsoft.com\/blog\/wp-content\/uploads\/2026\/11\/vibidsoft-blog-1659.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/#article\",\"name\":\"How to Debounce and Throttle a Callback with React Hooks\",\"headline\":\"How to Debounce and Throttle a Callback with React Hooks\",\"author\":{\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/author\\\/vibidsoft-team\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/#organization\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/vibidsoft-blog-1659.jpg\",\"width\":1600,\"height\":900,\"caption\":\"How to Debounce\\\/Throttle a Callback with React Hooks\"},\"datePublished\":\"2024-07-08T12:48:33+00:00\",\"dateModified\":\"2026-11-24T07:37:00+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/#webpage\"},\"articleSection\":\"React Native, API calls, callback, custom hooks, debounce, event handling, function throttling, input debouncing, React Hooks, React performance, React tutorial, responsive UI, search optimization, throttle, useDebounce, useThrottle\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/category\\\/react-native\\\/#listItem\",\"name\":\"React Native\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/category\\\/react-native\\\/#listItem\",\"position\":2,\"name\":\"React Native\",\"item\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/category\\\/react-native\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/#listItem\",\"name\":\"How to Debounce and Throttle a Callback with React Hooks\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/#listItem\",\"position\":3,\"name\":\"How to Debounce and Throttle a Callback with React Hooks\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/category\\\/react-native\\\/#listItem\",\"name\":\"React Native\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/#organization\",\"name\":\"Vibidsoft\",\"description\":\"Website and Mobile Apps Development Company\",\"url\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/\",\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/vibidsoft\",\"https:\\\/\\\/twitter.com\\\/vibidsoft\",\"https:\\\/\\\/www.instagram.com\\\/vibidsoft\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/vibidsoft\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/author\\\/vibidsoft-team\\\/#author\",\"url\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/author\\\/vibidsoft-team\\\/\",\"name\":\"Vibidsoft Engineering Team\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6df7f13c10b7e5466e1dcc71176af8b348b8d528b2dabfd83312ca964f7806e9?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Vibidsoft Engineering Team\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/#webpage\",\"url\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/\",\"name\":\"How to Debounce and Throttle a Callback with React Hooks\",\"description\":\"Correct useDebouncedCallback and useThrottledCallback hooks with cancel and flush, a debounced search, React 19 Strict Mode notes and useDeferredValue.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/author\\\/vibidsoft-team\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/author\\\/vibidsoft-team\\\/#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/11\\\/vibidsoft-blog-1659.jpg\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/#mainImage\",\"width\":1600,\"height\":900,\"caption\":\"How to Debounce\\\/Throttle a Callback with React Hooks\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/how-to-debounce-throttle-a-callback-with-react-hooks\\\/#mainImage\"},\"datePublished\":\"2024-07-08T12:48:33+00:00\",\"dateModified\":\"2026-11-24T07:37:00+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/\",\"name\":\"Vibidsoft\",\"description\":\"Website and Mobile Apps Development Company\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.vibidsoft.com\\\/blog\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"How to Debounce and Throttle a Callback with React Hooks","description":"Correct useDebouncedCallback and useThrottledCallback hooks with cancel and flush, a debounced search, React 19 Strict Mode notes and useDeferredValue.","canonical_url":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/","robots":"max-snippet:-1, max-image-preview:large, max-video-preview:-1","keywords":"","webmasterTools":{"p:domain_verify":"147eaec3c09ba1af5e17b00fa12931da","yandex-verification":"71876bdda9be7264","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/#article","name":"How to Debounce and Throttle a Callback with React Hooks","headline":"How to Debounce and Throttle a Callback with React Hooks","author":{"@id":"https:\/\/www.vibidsoft.com\/blog\/author\/vibidsoft-team\/#author"},"publisher":{"@id":"https:\/\/www.vibidsoft.com\/blog\/#organization"},"image":{"@type":"ImageObject","url":"https:\/\/www.vibidsoft.com\/blog\/wp-content\/uploads\/2026\/11\/vibidsoft-blog-1659.jpg","width":1600,"height":900,"caption":"How to Debounce\/Throttle a Callback with React Hooks"},"datePublished":"2024-07-08T12:48:33+00:00","dateModified":"2026-11-24T07:37:00+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/#webpage"},"isPartOf":{"@id":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/#webpage"},"articleSection":"React Native, API calls, callback, custom hooks, debounce, event handling, function throttling, input debouncing, React Hooks, React performance, React tutorial, responsive UI, search optimization, throttle, useDebounce, useThrottle"},{"@type":"BreadcrumbList","@id":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/www.vibidsoft.com\/blog\/#listItem","position":1,"name":"Home","item":"https:\/\/www.vibidsoft.com\/blog\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.vibidsoft.com\/blog\/category\/react-native\/#listItem","name":"React Native"}},{"@type":"ListItem","@id":"https:\/\/www.vibidsoft.com\/blog\/category\/react-native\/#listItem","position":2,"name":"React Native","item":"https:\/\/www.vibidsoft.com\/blog\/category\/react-native\/","nextItem":{"@type":"ListItem","@id":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/#listItem","name":"How to Debounce and Throttle a Callback with React Hooks"},"previousItem":{"@type":"ListItem","@id":"https:\/\/www.vibidsoft.com\/blog\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/#listItem","position":3,"name":"How to Debounce and Throttle a Callback with React Hooks","previousItem":{"@type":"ListItem","@id":"https:\/\/www.vibidsoft.com\/blog\/category\/react-native\/#listItem","name":"React Native"}}]},{"@type":"Organization","@id":"https:\/\/www.vibidsoft.com\/blog\/#organization","name":"Vibidsoft","description":"Website and Mobile Apps Development Company","url":"https:\/\/www.vibidsoft.com\/blog\/","sameAs":["https:\/\/www.facebook.com\/vibidsoft","https:\/\/twitter.com\/vibidsoft","https:\/\/www.instagram.com\/vibidsoft\/","https:\/\/www.linkedin.com\/company\/vibidsoft\/"]},{"@type":"Person","@id":"https:\/\/www.vibidsoft.com\/blog\/author\/vibidsoft-team\/#author","url":"https:\/\/www.vibidsoft.com\/blog\/author\/vibidsoft-team\/","name":"Vibidsoft Engineering Team","image":{"@type":"ImageObject","@id":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/6df7f13c10b7e5466e1dcc71176af8b348b8d528b2dabfd83312ca964f7806e9?s=96&d=mm&r=g","width":96,"height":96,"caption":"Vibidsoft Engineering Team"}},{"@type":"WebPage","@id":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/#webpage","url":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/","name":"How to Debounce and Throttle a Callback with React Hooks","description":"Correct useDebouncedCallback and useThrottledCallback hooks with cancel and flush, a debounced search, React 19 Strict Mode notes and useDeferredValue.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/www.vibidsoft.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/#breadcrumblist"},"author":{"@id":"https:\/\/www.vibidsoft.com\/blog\/author\/vibidsoft-team\/#author"},"creator":{"@id":"https:\/\/www.vibidsoft.com\/blog\/author\/vibidsoft-team\/#author"},"image":{"@type":"ImageObject","url":"https:\/\/www.vibidsoft.com\/blog\/wp-content\/uploads\/2026\/11\/vibidsoft-blog-1659.jpg","@id":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/#mainImage","width":1600,"height":900,"caption":"How to Debounce\/Throttle a Callback with React Hooks"},"primaryImageOfPage":{"@id":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/#mainImage"},"datePublished":"2024-07-08T12:48:33+00:00","dateModified":"2026-11-24T07:37:00+00:00"},{"@type":"WebSite","@id":"https:\/\/www.vibidsoft.com\/blog\/#website","url":"https:\/\/www.vibidsoft.com\/blog\/","name":"Vibidsoft","description":"Website and Mobile Apps Development Company","inLanguage":"en-US","publisher":{"@id":"https:\/\/www.vibidsoft.com\/blog\/#organization"}}]},"og:locale":"en_US","og:site_name":"Vibidsoft | Website and Mobile Apps Development Company","og:type":"article","og:title":"How to Debounce and Throttle a Callback with React Hooks","og:description":"Correct useDebouncedCallback and useThrottledCallback hooks with cancel and flush, a debounced search, React 19 Strict Mode notes and useDeferredValue.","og:url":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/","article:published_time":"2024-07-08T12:48:33+00:00","article:modified_time":"2026-11-24T07:37:00+00:00","article:publisher":"https:\/\/www.facebook.com\/vibidsoft","og:image":"https:\/\/www.vibidsoft.com\/blog\/wp-content\/uploads\/2026\/11\/vibidsoft-blog-1659.jpg","twitter:card":"summary_large_image","twitter:site":"@vibidsoft","twitter:title":"How to Debounce and Throttle a Callback with React Hooks","twitter:description":"Correct useDebouncedCallback and useThrottledCallback hooks with cancel and flush, a debounced search, React 19 Strict Mode notes and useDeferredValue.","twitter:creator":"@vibidsoft","twitter:image":"https:\/\/www.vibidsoft.com\/blog\/wp-content\/uploads\/2026\/11\/vibidsoft-blog-1659.jpg"},"aioseo_meta_data":{"post_id":"1659","title":"How to Debounce and Throttle a Callback with React Hooks","description":"Correct useDebouncedCallback and useThrottledCallback hooks with cancel and flush, a debounced search, React 19 Strict Mode notes and useDeferredValue.","keywords":null,"keyphrases":{"focus":{"keyphrase":"React Hooks","score":68,"analysis":{"keyphraseInTitle":{"title":"Focus keyphrase in SEO title","description":"Focus keyphrase found in SEO title.","score":9,"maxScore":9,"error":0},"keyphraseInDescription":{"title":"Focus keyphrase in meta description","description":"Focus keyphrase found in meta description.","score":9,"maxScore":9,"error":0},"keyphraseLength":{"title":"Focus keyphrase length","description":"Good job!","score":9,"maxScore":9,"error":0,"length":2},"keyphraseInURL":{"title":"Focus keyphrase in URL","description":"Focus keyphrase not found in the URL.","score":1,"maxScore":5,"error":1},"keyphraseInIntroduction":{"title":"Focus keyphrase in introduction","description":"Your Focus keyphrase does not appear in the first paragraph. Make sure the topic is clear immediately.","score":3,"maxScore":9,"error":1},"keyphraseInSubHeadings":{"title":"Focus keyphrase in Subheadings","description":"Use more focus keyphrases in your H2 and H3 subheadings!","score":3,"maxScore":9,"error":1},"keyphraseInImageAlt":[]}},"additional":[]},"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":"","og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":"-1","robots_max_videopreview":"-1","robots_max_imagepreview":"large","priority":null,"frequency":"default","local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2024-07-08 12:44:59","updated":"2026-11-24 10:15:02","focus_keyword":"React Hooks","additional_keywords":null,"truseo_locale":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.vibidsoft.com\/blog\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/www.vibidsoft.com\/blog\/category\/react-native\/\" title=\"React Native\">React Native<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tHow to Debounce and Throttle a Callback with React Hooks\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/www.vibidsoft.com\/blog\/"},{"label":"React Native","link":"https:\/\/www.vibidsoft.com\/blog\/category\/react-native\/"},{"label":"How to Debounce and Throttle a Callback with React Hooks","link":"https:\/\/www.vibidsoft.com\/blog\/how-to-debounce-throttle-a-callback-with-react-hooks\/"}],"_links":{"self":[{"href":"https:\/\/www.vibidsoft.com\/blog\/wp-json\/wp\/v2\/posts\/1659","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.vibidsoft.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.vibidsoft.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.vibidsoft.com\/blog\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/www.vibidsoft.com\/blog\/wp-json\/wp\/v2\/comments?post=1659"}],"version-history":[{"count":4,"href":"https:\/\/www.vibidsoft.com\/blog\/wp-json\/wp\/v2\/posts\/1659\/revisions"}],"predecessor-version":[{"id":3707,"href":"https:\/\/www.vibidsoft.com\/blog\/wp-json\/wp\/v2\/posts\/1659\/revisions\/3707"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.vibidsoft.com\/blog\/wp-json\/wp\/v2\/media\/3300"}],"wp:attachment":[{"href":"https:\/\/www.vibidsoft.com\/blog\/wp-json\/wp\/v2\/media?parent=1659"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.vibidsoft.com\/blog\/wp-json\/wp\/v2\/categories?post=1659"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.vibidsoft.com\/blog\/wp-json\/wp\/v2\/tags?post=1659"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}