Tema:
getServerSideProps o getStaticPropsnpm run build y luego npm run start desde mi máquina local, pero sí en el sitio en vivo y npm run devCódigo para la página:
const Index = ({ properties, total }) => { return ( <Container> <DashboardDrawer /> <Search /> <PropertyList properties={properties} /> <Pagination page={1} total={total} /> </Container> ); }; export default Index; export const getServerSideProps = async ({ query: { page = 1 } }) => { // Calculate start page const start = +page === 1 ? 0 : (+page - 1) * PER_PAGE; // Fetch total/count const totalRes = await fetch(`${API_URL}/properties/count`); const total = await totalRes.json(); // Fetch properties const propertyRes = await fetch( `${API_URL}/properties?_limit=${PER_PAGE}&_start=${start}` ); const properties = await propertyRes.json(); return { props: { properties, page: +page, total }, }; };