Skip to content
Discussion options

You must be logged in to vote

Hey @softwarepark
If you are using the experimental app directory in Next.js, all of the components inside the app folder are server components by default. This means you can create your component including your data async like so:

export default async function Page() {
  const products = await swell.products.list({
    limit: 25,
    page: 1
  })
  return (
    <code>
      {products}
    </code>
  );
}

Hopefully this answers your question!

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by logeshswell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
2 participants