Simple Frontend Pagination | React

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • In this video we will implement some custom pagination in React to get a certain number of fetched posts per page. We will be using the useState and useEffect hooks as well.
    Code:
    github.com/bradtraversy/simpl...
    Sponsor: Freelancer Bundle (Use "brad25" for 25% off)
    studywebdevelopment.com/freel...
    💖 Become a Patron: Show support & get perks!
    / traversymedia
    Website & Udemy Courses
    www.traversymedia.com
    Follow Traversy Media:
    / traversymedia
    / traversymedia
    / traversymedia
  • Věda a technologie

Komentáře • 501

  • @WorldXKIZOation
    @WorldXKIZOation Před 2 lety +29

    Even in 2022, This Tutorial is still REALLY HELPFUL!
    Brad, your videos are such a HUGE help. THANK YOU!!

  • @michelezucca5819
    @michelezucca5819 Před 3 lety +80

    This is like the easiest and most simple way of paginating with React I've seen, much better than many other tutorials, hats off Brad you're always the man

  • @joejorgensen4509
    @joejorgensen4509 Před 2 lety +2

    This was possibly the best coding tutorial I've ever watched. I've been browsing google for hours just trying to find a decent tutorial and this was easily the best, super straight and to the point and great at explaining everything thats going on. Thank You!

  • @oussemamiled4545
    @oussemamiled4545 Před 5 lety +29

    brad, i really don't have much time but when you post a video, like it's a must watch

  • @pavleta777
    @pavleta777 Před 2 lety +2

    Thank you, Brad! This tutorial was extremely useful! I was struggling with Material UI as beginner in React but you made building pagination to look so easy and clean! You thought me so much and I am very grateful to everything you do for us! Much love!

  • @vince9593
    @vince9593 Před 3 lety +1

    Great video TM. You explain things so clearly with additional 'why we do this...' thrown in which gives context rather than just running through lines of code. Thanks !

  • @denniszenanywhere
    @denniszenanywhere Před 5 lety +4

    Waking up with a new Brad video is the best. Thanks!

  • @RobertTodar
    @RobertTodar Před 5 lety +5

    I love these short and simple lessons. I learned so much from this. Thank you!

  • @farhan787
    @farhan787 Před 4 lety +12

    I can't thank you enough Brad, THAAAAAANNNNNNKKKKKKKKKKKSSSSSSSSSSS. a lot for this, I needed to implement it in one of my project on my new job and I'm not good at frontend but because of you, I was able to implement it ❤️❤️❤️❤️

  • @Gogetta94
    @Gogetta94 Před 4 lety +1

    I began taking his class in udemy about a month ago and I will take his courses ever since. great teacher of mine

  • @rez41
    @rez41 Před 5 lety +1

    This is great. I'm just getting to grips with React and hooks so this was perfect - I may even use pagination in my next project now. Thanks Brad

  • @igoralves1925
    @igoralves1925 Před 3 lety

    i've searching about it for a few hours, I watched some video and read some blogs but your content was the only one that really helped me . Thanks !

  • @narendrajoshi5460
    @narendrajoshi5460 Před 5 lety +1

    Thank you so much Brad. I was the guy who asked for this video..Thank you again for your work..you are my god and my inspiration

  • @pam_prunelle1693
    @pam_prunelle1693 Před 3 lety

    With your tutos, I progressed, raised my level. A big thank-you
    Brad Traversy

  • @ericmomoh7927
    @ericmomoh7927 Před rokem +1

    Finally I saw i pagination tutorials that doesn't use a paginated library. Perfect to learn how that really works with actual code.

  • @diegogimbernat9253
    @diegogimbernat9253 Před 4 lety +2

    Dude, I'm putting an altar of you next to my desk, it's official. U are such a great teacher, thanks for all the great content.

  • @IsaacAsante17
    @IsaacAsante17 Před 5 lety +1

    You actually listened to the request from your users. You really care about your viewers! 😃

  • @AbdulelahAlJeffery
    @AbdulelahAlJeffery Před 5 lety +154

    Traversy Media is the new Khan Academy for all things web .. excellent job Brad!

    • @romanpabianczyk8870
      @romanpabianczyk8870 Před 4 lety

      Bullshit. This code doesn't work for me.

    • @avthreek
      @avthreek Před 4 lety +3

      @@romanpabianczyk8870 yeah, it only does for small amount of results. Not for thousands as Brad said in the end.

    • @yusuffakhreddin263
      @yusuffakhreddin263 Před 4 lety

      @@avthreek do you know why ?

    • @avthreek
      @avthreek Před 4 lety +6

      @@yusuffakhreddin263 it is easier to fetch small amount of results when needed, rather than getting ALL the results and paginating them on the front end.
      For example my table have millions of rows and those rows have even more results attached in foreign tables. So loading them All is very expensive in a loading time and size and it is also unnecessary if user wants to get for example second page results and he will never reach third page. For such large data we paginate on the back end and retrieve pieces of data.

    • @yusuffakhreddin263
      @yusuffakhreddin263 Před 4 lety +2

      @@avthreek thank you

  • @HermesNautico
    @HermesNautico Před 4 lety +1

    Thanks, Brad. This was my first intro to pagination. I tried another instructor but he uses 'lodash' for something you made so simple.

  • @matthiasmatanda4295
    @matthiasmatanda4295 Před měsícem

    I watched this in 2024, still a valid tutorial, thanks God for Brand Traversy Media

  • @shivanimathur1356
    @shivanimathur1356 Před 3 lety

    Thank you for making this so easy, I've been hitting my head on pagination for 3 days

  • @hn031
    @hn031 Před 4 lety

    Thanks man. I'm at point in a project where I had to chose which pagination to use. The data coming from the backend is already paginated, but I don't like that a new request had to be sent to the backend each time a new page is requested; I consider this too much load. Then I didn't want to use a package to paginate my data. What I'm left with is to learn how to do the pagination; you just helped out. Thanks a lot . You're saving tons of life and jobs.

  • @viktoriazubchenko5428
    @viktoriazubchenko5428 Před 3 lety

    wow! Thank you for your video, it was so helpful for me, not only as pagination tutorial, but also as a short lesson about how cool hooks are.

  • @Mathis-zk7uq
    @Mathis-zk7uq Před 5 lety +3

    Thank you very much :) Can't wait for the full stack video !!!

  • @tomasliendo3127
    @tomasliendo3127 Před rokem

    Incredible tutorial :D , well explained step by step and not skipping anything, the truth has helped me a lot, thanks for the time! Greetings from Argentina.

  • @kaytiwari6018
    @kaytiwari6018 Před 2 lety +1

    Phenomenal video, that was crystal clear. Thanks for posting the code too, I'm gonna practice with the Json file. I have a react technical interview coming up so thanks so much for this.

  • @dzajakeks5539
    @dzajakeks5539 Před 8 měsíci

    Okay this one really helped, thank you. Even after 4 years, your content is helpful

  • @madeinbalcony7237
    @madeinbalcony7237 Před 4 lety

    this is worth not skipping ads. as always, thanks brad :D

  • @aurimasrimkus4705
    @aurimasrimkus4705 Před 2 lety +1

    This is just amazing, so simple and works like a charm!

  • @mekabeka23
    @mekabeka23 Před 4 lety +18

    This was the simplest tutorial I've seen all day on pagination. Thank you. I understood 100% all while the simple way to use hooks. You're awesome.

  • @aaronkagandev
    @aaronkagandev Před rokem

    Dude you're a G. This is by far the cleanest way i've seen so far

  • @GabrielRamirez-rm7qh
    @GabrielRamirez-rm7qh Před rokem +49

    PSA: If using this pagination component inside of a route ,the anchor tag will navigate you away from your route and throw an error. The "!# href is a hack to trigger javascript while avoiding side effects. It can work in some cases but is not semantically correct . The fix for this, and semantically correct option would be to simply remove the href attribute and use a button tag instead of an anchor tag.

  • @kimmotech
    @kimmotech Před 2 lety

    Thanks a lot man, this really helped me understand how pagination works and now I have a full component I can always reuse

  • @shauntonesify
    @shauntonesify Před 4 lety

    I love you Brad, you saved my life again on another project.

  • @rodolfoleal7295
    @rodolfoleal7295 Před 4 lety

    Just used it on my project. Thank you very much Brad!

  • @Colstonewall
    @Colstonewall Před 5 lety

    Just what I needed and wanted. Thank you Brad!

  • @arifeljutviovska7672
    @arifeljutviovska7672 Před 3 lety

    Man I love you I was searching everywhere for this and it works thank you so much

  • @TheNikola2910
    @TheNikola2910 Před 4 lety +3

    This helped me get a job! Thank you so much Brad!

  • @julielesage960
    @julielesage960 Před 4 lety

    Perfect clear and simple, up to date code, and I love your voice ! many thanks

  • @roman_mf
    @roman_mf Před rokem

    Thank you so much Brad! Exactly what I was looking for. This approach was super useful for my own project.

  • @Hashmimohammed
    @Hashmimohammed Před 5 lety

    Transforming many lives with your work. You Rock

  • @wingsaber629
    @wingsaber629 Před 5 lety +1

    Thanks Brad! SUPER USEFUL. For the full-stack, put pagination it in your MERN stack course! I will be doing that. Thanks.

  • @randolphperkins6584
    @randolphperkins6584 Před rokem

    Great video! I completed this tutorial, and I am looking forward to watching a pagination lesson using the back end. Thank you!

  • @Buffnerd_i
    @Buffnerd_i Před 2 lety

    Kind of amazed by how easy this was, ty Brad!

  • @patineira1323
    @patineira1323 Před 4 lety

    Simple but solves the need it. Amazing your explanation, thank you so much!

  • @edwardhui6274
    @edwardhui6274 Před 4 lety

    Straight on point! Great tutorial for pagination on front-end side!

  • @markkatona4501
    @markkatona4501 Před rokem

    this video was really helpful, I saw many of them about pagination, but this is a quality content, thank you so much :D

  • @karma_yogi_42
    @karma_yogi_42 Před 3 lety

    what a life saver!
    thanks needed this for a interview assignment!

  • @ridl27
    @ridl27 Před 5 lety +1

    Thank you Brad for another one useful video. Waiting for full-stack pagination! =)

  • @BadtzCarol
    @BadtzCarol Před 3 lety

    Thank you so much for the awesome tutorial!
    Now I have a pagination component that can use in every project

  • @kevinurielfonseca
    @kevinurielfonseca Před 5 lety +1

    Exactly what I was looking for, thanks!

  • @Kagmajn
    @Kagmajn Před 5 lety

    wow, you just solved my problem for my current project, well i think i have to check the full tutorial for the react

  • @coolpriyanks
    @coolpriyanks Před 3 lety

    simple and to the point video. Thank you for making it!

  • @kiransurage
    @kiransurage Před 5 lety

    Anyone else hits the Like button as they start watching, bcuz its Brad, and u just know it's going to be awesome?

  • @gsalazarmusic
    @gsalazarmusic Před 3 lety

    Dude!!! Thank you so much! My nightmares doing paginations are over!!!

  • @natefr0st239
    @natefr0st239 Před 5 lety

    I liked the video before I even watch it, because I know it's gonna be a good one as any other in that channel.

  • @nakimapi
    @nakimapi Před 3 lety

    What a great video! Exactly what I was looking for!

  • @yutamatsumoto7234
    @yutamatsumoto7234 Před 3 lety

    just what I needed the most. thank you for the excellent job!

  • @kingofgods898
    @kingofgods898 Před 3 lety

    Exactly what I was looking for, thank you!

  • @manasiroy9510
    @manasiroy9510 Před 4 lety +2

    Who dislikes this amazing video? This is very very helpful. I just love it.

    • @emreaka3965
      @emreaka3965 Před 3 lety

      They should comment that why did not they dislike the video for. ^^

  • @parasarora5869
    @parasarora5869 Před 5 lety

    loved it !!...wanted to learn this for a long time 😄 thank uuu

  • @ashokk9289
    @ashokk9289 Před 2 lety

    This is the Best and Easiest Pagination I've ever seen. Thank You Soo Much for this Wonderful video Brad. I'm Your new Subscriber

  • @TheAditya64
    @TheAditya64 Před 5 lety

    Great work Brad.... As always loved the work.

  • @francisfernando4605
    @francisfernando4605 Před 2 lety

    Very easy to understand. Great tutorials. Thank you so much

  • @isbaccas
    @isbaccas Před 3 lety +1

    Thank you so much for the great walk-through. I was able to adapt this simple code into a table that stored all my accounts.
    The switch from front end to backend was also super easy. Just needed to pull from a server with my data and use a limit and offset for the data. The rest of the page work is done front end.

  • @adrianzawadzki1900
    @adrianzawadzki1900 Před 5 lety

    Great guide, solved the problem in my project, thanks!

  • @josuedanielflores2008
    @josuedanielflores2008 Před 4 lety

    So useful, thanks for creating this kind of content!

  • @ShubhamRathod-jg9gt
    @ShubhamRathod-jg9gt Před 5 lety +2

    Keep post more on React.js related topics (: and congratulations for 777K subscribers

  • @marcuszierke7930
    @marcuszierke7930 Před 5 lety

    No idea what those 12 haters have to complain about - amazing video, simple, efficient and great way of explaining.

  • @JustAnotherGuyBloger
    @JustAnotherGuyBloger Před 3 lety

    Greetings from brazil!
    All that i needed, thanks!

  • @andrewcodes
    @andrewcodes Před 5 lety +1

    Amazing, been searching for something like this everywhere!
    It would be amazing would be if you could do it where you don't load then unless you click second or third page etc, only load recourses required - Just like you mentioned in your video. Thanks again!

  • @eugenemusebe4963
    @eugenemusebe4963 Před 5 lety

    I really needed this. Thanks brad

  • @Szchmausser
    @Szchmausser Před 3 lety

    You are a BOSS! Thank you, very concise and helpful.

  • @jasonlee7227
    @jasonlee7227 Před 2 lety

    Thank you soo much, Brad! I really needed this. God bless you.

  • @MrMiguelapb35
    @MrMiguelapb35 Před 4 lety

    straightforward and functional, perfect

  • @carlosg8716
    @carlosg8716 Před 4 lety

    Great explanation. Thanks for all your work.

  • @javadmohammadi3943
    @javadmohammadi3943 Před 2 lety

    oh thank God finally I find the best video about pagination

  • @devendradeo5833
    @devendradeo5833 Před 2 lety

    Thanks buddy for the example, it is very simple and correctly explained.

  • @dermotsheerin5672
    @dermotsheerin5672 Před 4 lety

    Thanks a mill Brad that was excellent.....as always you explain all steps

  • @rebelmachine88
    @rebelmachine88 Před 5 lety

    Thank you for this one, Brad!

  • @sudharshaniyengar1587
    @sudharshaniyengar1587 Před 4 lety

    Thanks Brad .. Love such cut short videos

  • @tarellmorris4621
    @tarellmorris4621 Před 3 lety

    This saved my life. Thank you!

  • @MiguelRochaOporto
    @MiguelRochaOporto Před 4 lety

    Excelent! Thank you very much. Now I go implement Search in table!

  • @amirsohail2630
    @amirsohail2630 Před 4 lety

    It was very helpful. Thank you Brad!

  • @pirouz_roshanzamir
    @pirouz_roshanzamir Před 3 lety

    U have no idea how much time this saved me

  • @Rolanditou
    @Rolanditou Před 4 lety

    BRAD GOD BLESS YOU AND YOUR FAMILY FOR 100 GENERATIONS !!

  • @DanieleManca1983
    @DanieleManca1983 Před 5 lety

    Very good tutorial, I have a test with a similar task to complete, this video is perfect :)

  • @MistaT44
    @MistaT44 Před 5 lety

    Excellent video as always Brad! cheers

  • @md.fazlulkarim8847
    @md.fazlulkarim8847 Před 5 lety

    In the video, you wrote the useState code and right after that, you showed us how actually state and useState are similar. That took at best two seconds. But this type of little things makes you different than thousands of content creator.
    Please consider making a short course on Algolia with react in the future? Take love...💛💛💛

  • @smsibasish
    @smsibasish Před 5 lety +41

    Congrats Brad for 777k subscribers 😄

  • @antonyserralta
    @antonyserralta Před 5 lety

    Wooow, simple, excellent. I ❤️ u Brad

  • @yangwang24
    @yangwang24 Před 3 lety

    Got a similar interview question like this, thanks a lot.

  • @sunnydevtale3021
    @sunnydevtale3021 Před 2 lety

    Thank you, Brad! This tutorial was Awsome.!

  • @siddhantganesh
    @siddhantganesh Před 3 lety

    Thanks for your effort . I really appreciate what u r doing ❤️

  • @SAR_Ardent_devotee
    @SAR_Ardent_devotee Před 5 lety

    Thank you for this tutorial it really helped me out. I am having trouble in implementing the scrolling technique for pagination. If you could make a tutorial on that it would be really amazing.

  • @yaoxiao6897
    @yaoxiao6897 Před rokem

    Awesome, clear and simple to follow.

  • @romimaximus
    @romimaximus Před 4 lety

    Brad you are the Man !! Thank you so much !!

  • @matthewgarcia3540
    @matthewgarcia3540 Před 10 měsíci

    EVEN IN 2023 this was helpful with a bit tweaks from newer hooks that reacts has now this is great thanks!

  • @maxwilsonpereira
    @maxwilsonpereira Před 3 lety

    Thank you so much! Already implemented on my project! :-D

  • @jesuscortessantacruz5757

    Amazing, still works today thank you