Skip to content

ntcore-ts / @ntcore-ts/react / useConnectionStatus

Function: useConnectionStatus() ​

useConnectionStatus(): object

Defined in: react/src/lib/use-connection-status.ts:13

Subscribes to robot connection status and returns the current state. Listener is removed on unmount. When connected, RTT (round-trip time in ms) is polled periodically; -1 when not connected or not yet measured. When disconnected, connecting reflects NetworkTables.isRobotConnecting().

Returns ​

object

.

connected ​

connected: boolean

connecting ​

connecting: boolean

rtt ​

rtt: number

Released under the MIT License.