Comments (7)
Hi. I am not sure that I understood your question properly.
I've noticed that current pagination library is meant to be used in a scenario when all data fetched once from the server.
this is not true. react-js-pagination is just simple component which can render pagination according to incoming props and know nothing about your data. It invokes onChange
every time when your user try to change page. It assumes that at onChange function you can fetch data from any random place (server, redux store, localStorage) or trigger some actions. Any other interactions you should handle by yourself.
As I said above, probably I did not understood your question. if you have some examples of source, please provide
from react-js-pagination.
parseInt worked for me:
<Pagination activePage={parseInt(this.props.activePage)}
from react-js-pagination.
Ok, I'll try again.
I have Pagination component that exists inside parent container component(I am not providing code of the parent, to verbose ):
const PaginationTab = ({itemsCount, handlePageChange, currentPage}) => (
<div className="pagination-tab">
<Pagination
activePage={currentPage}
itemsCountPerPage={10}
totalItemsCount={itemsCount}
pageRangeDisplayed={3}
onChange={handlePageChange}
/>
</div>);
"itemsCount", "handlePageChange", "currentPage" are props passed from parent component that will fetch data from the server and refresh upon page click (refreshing Pagination component as well)
I can see that "currentPage" prop is being passed to component correctly in every case, and all works properly, except that fact that page number that corresponds to "active page" is not highlighted in a browser.
Highlighting works only if Pagination component is not being refreshed after page click(and it happens only if I already visited the page and have corresponding data in a local store - so parent component isn't updated and doesn't trigger children refresh).
from react-js-pagination.
hey @maretOlia, could you replicate this scenario in something like webpackbin so that we can check?
I've worked with this library before with completely on-demand pages, and didn't have this issue 🤔
You can use the React boilerplate in webpackbin, and quickly draft the POC :)
from react-js-pagination.
Thanks to all of you. I've found a way to do what I needed with a vanilla react-bootstrap component. So I am closing this issue
from react-js-pagination.
i'm also having this issue, whats the solution
from react-js-pagination.
Thanks to all of you. I've found a way to do what I needed with a vanilla react-bootstrap component. So I am closing this issue
Can you tell us how you solved this issue, as i'm experiencing the same issue
from react-js-pagination.
Related Issues (20)
- Multiple React Instances HOT 1
- Multiple React Instances HOT 4
- How can i show the last page number?
- How can i show the last page number?
- How can i show the last page number?
- Npm install Fails HOT 1
- Don't Receive pageNumber as arg by hooks HOT 1
- How can I add simple href url? HOT 1
- No Way to Track Previous, Next, First, Last Page Events
- 2 instances of react detected because of react-js-pagination
- Cannot set both active and inactive classes
- Wrong URL in the Description
- Num of pages was incorrect HOT 1
- Is this package still maintained? HOT 2
- `pageRangeDisplayed` prop not working
- 2 high severity vulnerabilities HOT 2
- Is this project still maintained?
- Navigation does not work
- Change activePage but Paga not change
- Release 3.0.4? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-js-pagination.