Vidact – 一个将 React 转换为直接 DOM 操作的编译器
Vidact – a compiler that turns React into direct DOM operations

原始链接: https://www.vidact.dev/

Vidact Start 增加了文件路由、服务器加载器、SSR、水合作用(hydration)和客户端导航,所有这些都由同一个编译器生成,因此服务器和浏览器的输出在构建时即保持一致。 探索 Vidact Start `src/routes/products/$productId.tsx` ```tsx import { defineFileRoute } from '@vidact/start' const loader = async ({ params }) => ({ product: await findProduct(params.productId), }) export function ProductRoute({ loaderData }) { return

{loaderData.product.name}

} export const Route = defineFileRoute({ loader, component: ProductRoute, }) ```

抱歉。
相关文章

原文

Vidact Start adds file routes, server loaders, SSR, hydration, and client navigation, all generated by the same compiler, so server and browser output match by construction.

Explore Vidact Start

src/routes/products/$productId.tsx

import { defineFileRoute } from '@vidact/start'const loader = async ({ params }) => ({  product: await findProduct(params.productId),})export function ProductRoute({ loaderData }) {  return <h1>{loaderData.product.name}</h1>}export const Route = defineFileRoute({  loader,  component: ProductRoute,})
联系我们 contact @ memedata.com