stephane-monnot / react-vertical-timeline

Vertical timeline for React.js
https://stephane-monnot.github.io/react-vertical-timeline/
MIT License
1.08k stars 158 forks source link

Can timeline Component Support Pagination? #58

Closed subodhcjoshi82 closed 4 years ago

subodhcjoshi82 commented 4 years ago

Hi Can you please tell if this component support Pagination feature...Suppose i want to load 10 record a time and when click on next then next 10 should load or scrolling down should load next 10 items?

stephane-monnot commented 4 years ago

Hi,

You have to implement this feature in your component.

  1. Create a button to load new data
  2. Build VerticalTimeline children with a props (ex: records) (Use redux if need)
  3. If user clicks on "Load new data" button, add more 10 items to records props.
  4. You component will rerender with the additional 10 records.
stephane-monnot commented 4 years ago

I added a demo for you ;) : https://stephane-monnot.github.io/react-vertical-timeline/#/demo-load-more

You could use this script as inspiration.

subodhcjoshi82 commented 4 years ago

Thanks will test and update you further.