question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setting new selected value post-mount

See original GitHub issue

I’m attempting to manipulate the selected page number of PaginationBoxView without a user click (such as on pushState) after the component has been mounted. What I found was that the selected state wasn’t updating because that state is only set before the initial mount.

I opened a PR with a simple solution using componentWillReceiveProps, let me know if this is appropriate: #61

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:2
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
AdeleDcommented, Sep 6, 2020

You should be able to do what you want by updating the forcePage prop each time you want to change the selected page.

<ReactPaginate forcePage={2} />
0reactions
AdeleDcommented, Sep 13, 2020

Hello, In case it can help you, on version 6.5.0 of react-paginate, you can now define the event you want to listen onto. You just need to instantiate the component with an eventListener prop.

For instance:

<ReactPaginate eventListener="onTouchStart" />
Read more comments on GitHub >

github_iconTop Results From Across the Web

Developers - Setting new selected value post-mount - - Bountysource
I'm attempting to manipulate the selected page number of PaginationBoxView without a user click (such as on pushState) after the component has been...
Read more >
Post-Mount with componentDidMount() · react-indepth
This method is called once all our children Elements and our Component instances are mounted onto the Native UI. When this method is...
Read more >
How to set selected value of jQuery Select2? - Stack Overflow
1. I was trying with the id only select2('val', '1') but it wasn't work.. Thanks · 6. This does work, just wanted to...
Read more >
3 Things You Can Do to Improve Your Post Mount Mailbox
In this article, The Mailboxworks looks at post mount mailbox accessories and three key elements that will add value to your curbside ...
Read more >
SRAM/Avid Disc Post Mount Spacer Set - Jenson USA
Avid Disc Post Mount Adaptor Avid disc caliper spacer set. Doing away with brake adaptor brackets this spacer kit will allow you to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found