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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependent fetching on list of urls #97

Closed
waptik opened this issue Nov 7, 2019 · 2 comments
Closed

Dependent fetching on list of urls #97

waptik opened this issue Nov 7, 2019 · 2 comments
Labels

Comments

@waptik
Copy link

waptik commented Nov 7, 2019

First of all, thanks 馃憤 for this awesome library. Heard about it on zeit's twiiter page this week and i wanted to try my hands on it.

This issue is related to #71 . In my case, i'll like to get info of each pokemon for each pokemon's url from the api, instead of displaying info based on a clicked pokemon.
I'm using the pokemon api as an example. demo is 鉃★笍 codesandbox

@shuding
Copy link
Member

shuding commented Nov 7, 2019

Hi @waptik !

React doesn't allow people to use dynamic number of Hooks inside a component. But you can move each pokemon into their own component and fetch via SWR inside. I forked your demo: https://codesandbox.io/s/happy-bhaskara-vgsf7

@waptik
Copy link
Author

waptik commented Nov 8, 2019

Thanks it works. I forgot that breaking things into components makes life easier.

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

No branches or pull requests

2 participants