VKumar786 / NextJs-Udemy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

export const getStaticPaths = async () => { const data = await(await fetch()).json() const allUserIds = data.users.map((user) => user.id)

return {
    paths: allUserIds.map((userId) => ({ params: {id : `${userId}`}})),
    fallback: false,
}

}

export const getStaticProps = async (context) => { const id = context.params.id const data - await(await fetch()).json() return { props: { data, } } }

export const getQuotes = async () => { return await (await fetch("", {cache: "force-cache"})).json() }

export page = async () => { const quotes = await getQuotes() return (

{quotes.map((quote, index) => { return <Link href={ pathname: "/blog", query: {quote: quote} }> })}
) }

export page = async ({ searchParams }) => { kf return (

{searchParams.quote}
) }

useSWR()

Next Export vs NEXT BUILD

image -> layout == responsive

About


Languages

Language:JavaScript 40.9%Language:TypeScript 31.1%Language:CSS 27.3%Language:HTML 0.5%Language:MDX 0.2%