Next.js
LI.FI 组件 与 Next.js 应用程序完全兼容,需要最少的配置即可无缝集成。 由于 Next.js 中服务器端渲染(SSR)的性质以及不同钱包库管理与钱包扩展连接的方式,LI.FI 组件需要在客户端专门渲染。为了实现这一点,请使用'use client' 指令,确保组件仅在客户端环境中渲染。
请查看我们在组件仓库中的完整示例这里。
如果您使用带有 App Router 的 Next.js,以下示例显示如何将组件添加到页面:
Widget Skeleton
As you can see from the Next.js example, for users convenience we provide theWidgetSkeleton component that can be used as a fallback while the main widget component is being loaded.
The
WidgetSkeleton component is currently only tested with中 Next.js environment and might not work with other SSR frameworks.

