The current page and the current page input share the same value, so the useEffect hook can be simplified.