SolidJSS
SolidJSโ€ข4y agoโ€ข
33 replies
Nin

Rerender child component with updated props

I've built a pagination component that takes a prop called totalPages, I've created a signal for this as I only know the totalPages once my createResource is done loading. However, the child component does not rerender when totalPages is updated. How do I make the component update itself?

Parent Code

const [totalPages, setTotalPages] = createSignal(0)


<Pagination
  pagesBuffer={5}
  totalPages={totalPages()}
  onChange={(index) => {
    setCurrentPage(index + 1)
    refetch()
    }
  }
/>
Was this page helpful?