Next.js template
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

index.js 738B

123456789101112131415161718192021222324252627
  1. import { dehydrate, QueryClient } from '@tanstack/react-query';
  2. import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
  3. import PaginationComponentRQ from '../components/pagination/react-query/PaginationComponentRQ';
  4. import { getData } from '../requests/dataRequest';
  5. const Home = () => {
  6. return (
  7. <>
  8. <PaginationComponentRQ></PaginationComponentRQ>
  9. </>
  10. );
  11. };
  12. export async function getStaticProps({ locale }) {
  13. const queryClient = new QueryClient();
  14. await queryClient.prefetchQuery(['randomData', 1], () => getData(1));
  15. return {
  16. props: {
  17. dehydratedState: dehydrate(queryClient),
  18. ...(await serverSideTranslations(locale, ['pagination'])),
  19. },
  20. };
  21. }
  22. export default Home;