Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

103
Views
React not updates component on store changes

I have component with cards. Needs to update it on page changing with Redux store. I understand why code is not working but have no idea how to fix it.

 function Cards(props) {
    const { beers = [] } = props
    const changePage = (newPage) => {
        page = newPage
    }
    let page = store.getState().pages
    
    store.subscribe(() => changePage(store.getState().pages))
    return (
        <div className='cards'>
            <div className='cards__content'>
                {beers.slice(page*9, page*9+9).map(beer => <MenuCard name={beer.name} description={beer.brewers_tips} id={beer.id} key={beer.id} />)}
            </div>
            <Pages amount={Math.floor(beers.length / 9)} />
        </div>
    )
}
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!