Open kylevalenzuela opened 3 years ago
I didn't find such a way, but I think that would be useful, right now re-render resets currentPage to 0. Also some way of accessing currentPage would be nice.
Maybe an easy first step would just be allowing to set "page" as a property, and keeping that page as state in some higher-order component? Or @kylevalenzuela would you prefer also handlers for triggering next/previous pages too?
Is it possible to retrieve current page somehow? I need to trigger an analytics event when the page changes. I didn't find the way with the current version, but maybe there is a way I didn't find. If it's not managed, can I make a PR to add this behavior?
Is there any way to set currentPage as a prop? Since this is a functional component, you can't use refs. Thanks.