Integrate Tetrons with server-side rendering and dynamic routes using Next.js.
Supports SSR for better performance and SEO.
Use Tetrons only where needed with dynamic imports.
Tuned for optimal performance with Next.js.
Create a new project.
npx create-next-app tetrons-next
Install Tetrons and dependencies.
npm install tetrons @tetrons/react
Add the editor to a page.
import dynamic from 'next/dynamic';
const TetronsEditor = dynamic(() => import('@tetrons/react'), {
ssr: false
});
export default function Page() {
return <TetronsEditor />;
}
Start the dev server.
npm run dev