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

add loadmore button #10

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

add loadmore button #10

wants to merge 7 commits into from

Conversation

YuriDevAT
Copy link
Owner

Description

I added a load more button functionality to only fetch 50 Pokemon at a time, until the user clicks on the button to load the next 50 Pokemon. The button disappears when all Pokemon are fetched.

This PR is only for the Pokedex.tsx. Kindly ignore the other files 😉

@YuriDevAT YuriDevAT requested a review from voidlaszlo October 30, 2022 17:36
@netlify
Copy link

netlify bot commented Oct 30, 2022

Deploy Preview for pokemon25 ready!

Name Link
🔨 Latest commit ee2a0b2
🔍 Latest deploy log https://app.netlify.com/sites/pokemon25/deploys/636f4d170b96f8000946322d
😎 Deploy Preview https://deploy-preview-10--pokemon25.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@YuriDevAT
Copy link
Owner Author

@voidlaszlo I tried some things in the pokedex.tsx component but could not prevent rerendering. I left a todo which could be a better way to fetch data, but not successful 😞

I am grateful for any tips. My idea would be to load the first let's say 20 pokemon and do some sort of "push" the next 20 pokemon for the existing array which may would prevent rerender...

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

Successfully merging this pull request may close these issues.

1 participant