Step by step tutorial on how to create a landing page
tutorialnext.jsreact

How to build a landing page in Next.js or React

This is a snippet from the docs that shows how to setup Destack with Next.js or React, either with a new project or an existing one.

You can learn more about destack here.

With a new Next.js project:

With an existing Next.js project:

1. Install Destack on your Next.js project
npm i destack
2. Setup the builder endpoint

Create pages/api/builder/handle.js and add the following:

export { handleEditor as default, config } from 'destack/build/server'
3. Then create a new page

On any Next.js page you want to setup Destack:

export { getStaticProps } from 'destack/build/server'
export { ContentProvider as default } from 'destack'

With a new React.js project:

With an existing React.js project:

1. Install Destack on your React.js project
npm i destack
2. Setup the builder endpoint

In package.json:

  • Replace the "start" script with destack -d \"react-scripts start\"
  • Then, replace the "build" script with destack -b \"react-scripts build\"
3. Then create a new page

In any React.js component you want to setup Destack:

export { ContentProviderReact as default } from 'destack'

If you need a landing page check out Destack
👉 It's free, open sourced and has no external dependencies.