Next.js template
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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;