Next.js 启动与演示

当您想要将 Next 适配器和 React 运行时一起使用时,请使用此轨道。

安装

bash
npm install @18ways/next @18ways/react

基础翻译游乐场

可编辑的游乐场源代码
app/layout.tsx
import './styles.css';
import type { ReactNode } from 'react';
import { WaysRoot } from '@18ways/next/server';

// Make sure this layout stays server-rendered so WaysRoot can read the request.
export default function RootLayout({ children }: { children: ReactNode }) {
  return (
    <html lang="en">
      <body className="next-demo-body">
        <WaysRoot>{children}</WaysRoot>
      </body>
    </html>
  );
}

预览
Next.js 入门与演示