GithubHelp home page GithubHelp logo

Comments (7)

wwwaiser avatar wwwaiser commented on May 26, 2024 1

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.

viacheslavkremeshnyi avatar viacheslavkremeshnyi commented on May 26, 2024 1

parseInt worked for me:
<Pagination activePage={parseInt(this.props.activePage)}

from react-js-pagination.

maretOlia avatar maretOlia commented on May 26, 2024

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.

wagoid avatar wagoid commented on May 26, 2024

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.

maretOlia avatar maretOlia commented on May 26, 2024

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.

AWR14 avatar AWR14 commented on May 26, 2024

i'm also having this issue, whats the solution

from react-js-pagination.

Mercy-1998 avatar Mercy-1998 commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.