2025-12-30 09:21:41 +08:00
|
|
|
import { IS_DEV } from '@/config'
|
2026-03-18 10:37:29 +08:00
|
|
|
import Script from '@/next/script'
|
2025-12-30 09:21:41 +08:00
|
|
|
|
2026-03-03 11:21:04 +08:00
|
|
|
export function ReactScanLoader() {
|
2026-07-12 23:57:46 +08:00
|
|
|
if (!IS_DEV) return null
|
2025-12-30 09:21:41 +08:00
|
|
|
|
|
|
|
|
return (
|
2026-03-03 11:21:04 +08:00
|
|
|
<Script
|
|
|
|
|
src="//unpkg.com/react-scan/dist/auto.global.js"
|
|
|
|
|
crossOrigin="anonymous"
|
2026-06-02 11:34:55 +08:00
|
|
|
// React Scan recommends beforeInteractive to catch initial renders, but it
|
|
|
|
|
// can mismatch with Dify's inline attribution bootstrap during dev hydration.
|
|
|
|
|
strategy="afterInteractive"
|
2026-03-03 11:21:04 +08:00
|
|
|
/>
|
2025-12-30 09:21:41 +08:00
|
|
|
)
|
|
|
|
|
}
|