All Lessons

A dashboard component uses useAgentState(agentId, "progress") to render a progress bar. The agent updates five different state fields per second, but only "progress" changes on most ticks. What is the practical benefit of subscribing to that one field instead of the whole agent state object?

1 / 3
intermediate 20 min

React Hooks

Loading lesson content...