Skip to content

Commit

Permalink
modificacion en el dynamic import
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignaherrero committed May 6, 2022
1 parent c0ff25b commit ffed7bd
Showing 1 changed file with 30 additions and 22 deletions.
52 changes: 30 additions & 22 deletions pages/index.jsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import dynamic from "next/dynamic";
import Head from "next/head";
import { useState } from "react";
import { Suspense, useState } from "react";
import { useForm } from "react-hook-form";
import { statusFetch } from "../helper/constants";
import { useCounter } from "../helper/useCounter";
const Card = dynamic(() => import("../components/card"));
const Pagination = dynamic(() => import("../components/pagination"));

const Search = dynamic(() => import("../components/search"));
const Card = dynamic(() => import("../components/card"), {
ssr: false,
});
const Pagination = dynamic(() => import("../components/pagination"), {
ssr: false,
});

export default function Home() {
const { IDLE } = statusFetch;
Expand All @@ -30,25 +35,28 @@ export default function Home() {
<title>MejorConsalud</title>
<meta name="description" content="contenido saludable" />
</Head>

<Search
articles={articles}
setArticles={setArticles}
handleSubmit={handleSubmit}
register={register}
reset={reset}
/>

<Card articles={articles} />

<Pagination
articles={articles}
getValues={getValues}
setArticles={setArticles}
counter={counter}
increment={increment}
decrement={decrement}
/>
<Suspense fallback={`...loading`}>
<Search
articles={articles}
setArticles={setArticles}
handleSubmit={handleSubmit}
register={register}
reset={reset}
/>
</Suspense>
<Suspense fallback={`...loading`}>
<Card articles={articles} />
</Suspense>
<Suspense fallback={`...loading`}>
<Pagination
articles={articles}
getValues={getValues}
setArticles={setArticles}
counter={counter}
increment={increment}
decrement={decrement}
/>
</Suspense>
</>
);
}
Expand Down

1 comment on commit ffed7bd

@vercel
Copy link

@vercel vercel bot commented on ffed7bd May 6, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

challenge-atomik – ./

challenge-atomik.vercel.app
challenge-atomik-git-main-nacho93.vercel.app
challenge-atomik-nacho93.vercel.app

Please sign in to comment.