admin管理员组

文章数量:1410674

I'm using TinaCMS in Next.js 15.

I'd like to use Tina's contextual editing but I would also like to have Next.js to compile the components server side, at build time.

However, if I want to use the tinaField helper it seems I have to use a useTina hook which requires "use client".

import { useTina, tinaField } from 'tinacms/dist/react'

const Page = (props) => {
  const { data } = useTina(props)
  return (
    <div>
      <h1 data-tina-field={tinaField(data, 'title')}>{data.title}</h1>
    </div>
  )
} 

Is there anyone who dealt with this issue and knows a solution?

本文标签: javascriptUse finafield helper in nextjs server componentStack Overflow