Dashboard
Active Users: {stats.activeUsers}
)
}
@endboostsnippet
@boostsnippet("Polling With Request Options and Manual Control", "react")
import { usePoll } from '@inertiajs/react'
export default function Dashboard({ stats }) {
const { start, stop } = usePoll(5000, {
only: ['stats'],
onStart() {
console.log('Polling request started')
},
onFinish() {
console.log('Polling request finished')
},
}, {
autoStart: false,
keepAlive: true,
})
return (