Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React Grid with Search #56

Closed
happylinks opened this issue Mar 28, 2020 · 2 comments
Closed

React Grid with Search #56

happylinks opened this issue Mar 28, 2020 · 2 comments

Comments

@happylinks
Copy link
Contributor

Hi, thanks for these components!
I was trying to implement the Grid with search, so each time an input changes its value, the Grid should fetch.
Do you have an example of how to do this?
I tried to add key={searchTerm} to the grid but then I got a lot of state-updates that went wrong because old api responses came in.

UI for reference:
image

@giannif
Copy link
Collaborator

giannif commented Mar 30, 2020

@happylinks I whipped up an example for you, I was actually thinking about doing this, figuring people would want to see it, thanks for pointing it out!

https://codesandbox.io/s/giphyreact-components-search-example-0yrur

I'll probably refine it a bit, I'm using hooks and a debounced input, hope it's clear

@happylinks
Copy link
Contributor Author

Thanks a lot! I think using your useDebounce hook fixed it. I was using a different debouncer(https://github.com/MinimaHQ/re-debouncer) that kind of behaved weirdly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants