question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Manual Pagination - useAsyncDebounce fn not a function

See original GitHub issue

Using 7.0.0-rc.15

Describe the bug Originally created a conversation on Spectrum but I believe since this is a bug it might be better suited to be on Github.

I’m running into a bug when trying to use useAsyncDebounce:

index.es.js:286 Uncaught (in promise) TypeError: fn is not a function
    at _callee$ (index.es.js:286)
    at tryCatch (runtime.js:45)
    at Generator.invoke [as _invoke] (runtime.js:271)
    at Generator.prototype.<computed> [as next] (runtime.js:97)
    at tryCatch (runtime.js:45)
    at invoke (runtime.js:135)
    at runtime.js:170
    at new Promise (<anonymous>)
    at callInvokeWithMethodAndArg (runtime.js:169)
    at AsyncIterator.enqueue [as _invoke] (runtime.js:192)

What I’m trying to accomplish:

  • Manual pagination that will take can use a search term and filters
  • Have a form that takes in a search term / filters.
  • When users submit that form, the pageIndex needs to be reset and new data needs to be requested from my API
  • When clicking over to the next page, the new data should be requested via api with the latest search term and filters

To Reproduce

For full steps on my exact use case and bug discovery (including my actual code) please visit the spectrum post. Will leave out my full code from the bug here.

I created a Sandbox for a simple recreation. The sandbox uses the pagination controlled example as it’s base and simply adds the useAsyncDebounce as described here

  1. Visit Sandbox
  2. Open chrome console
  3. You’ll see the error in the chrome console

Expected behavior I expect to not get an error and have a usable debounced function which will prevent pageIndex state being reset to 0 twice in order to avoid 2 consecutive data fetches.

Screenshots image

Desktop (please complete the following information):

  • OS: Mac Mojave 10.14.1
  • Browser: Chrome
  • Version: 79.0.3945.79

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:8

github_iconTop GitHub Comments

4reactions
tannerlinsleycommented, Jan 8, 2020

This will be fixed in the next release.

4reactions
tannerlinsleycommented, Dec 19, 2019

I’ll look into this ASAP. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Manual Pagination - useAsyncDebounce fn not a function #1794
I'm running into a bug when trying to use useAsyncDebounce: index.es.js:286 ... Manual Pagination - useAsyncDebounce fn not a function #1794.
Read more >
“functionName” is not a function while sending function as ...
I am new to React and Typescript, and I have some blog with content, and I am trying to add pagination to it....
Read more >
React Table Filter Dropdown - Vela Cloud
I will demonstrate to you how to create filter function as dropdown in ReactJS. ... key is actually referencing the list of custom...
Read more >
Control pagination - Microsoft Support
When you set pagination options, you can control where automatic page break are inserted or override automatic page breaks.
Read more >
How to use the react-table.useAsyncDebounce function ... - Snyk
To help you get started, we've selected a few react-table.useAsyncDebounce examples, based on popular ways it is used in public projects.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found