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.
Fork the destack-starter project
OR deploy a project to Vercel: link
OR preview it online with Gitpod: link
npm i destack
Create pages/api/builder/handle.js
and add the following:
export { handleEditor as default, config } from 'destack/build/server'
On any Next.js page you want to setup Destack:
export { getStaticProps } from 'destack/build/server'
export { ContentProvider as default } from 'destack'
Fork the destack-react-starter project
OR deploy a project to Vercel: link
OR preview it online with Gitpod: link
npm i destack
In package.json
:
destack -d \"react-scripts start\"
destack -b \"react-scripts build\"
In any React.js component you want to setup Destack:
export { ContentProviderReact as default } from 'destack'