next.js / packages /next /src /next-devtools /userspace /use-app-dev-rendering-indicator.tsx
AbdulElahGwaith's picture
Upload folder using huggingface_hub
b91e262 verified
'use client'
import { useEffect, useTransition } from 'react'
import { dispatcher } from 'next/dist/compiled/next-devtools'
export const useAppDevRenderingIndicator = () => {
const [isPending, startTransition] = useTransition()
useEffect(() => {
if (isPending) {
dispatcher.renderingIndicatorShow()
} else {
dispatcher.renderingIndicatorHide()
}
}, [isPending])
return startTransition
}