I have an application where I use a click counter.
const App = () => { const [nr, setNr] = useState(1); return ( <div> <p>{nr}</p> <Pagination defaultCurrent={nr} total={50} /> <button onClick={() => setNr(nr + 1)}>click</button> </div> ); }; Depending on the value the defaultCurrent should change in my Pagination component, but it is not working even the values are changing. Why the pages don't change when I click on the counter?
Demo: https://codesandbox.io/s/basic-ant-design-demo-ni423?file=/Test.js:183-386
buttonandp<Pagination current={nr} total={50} />