Next.js template
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

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;