# useTransportStatus
The `useTransportStatus` hook reports whether the transport has seen a discontinuity, and the latest error it reported that has no caller to reject. A discontinuity is a channel state change after which messages may have been missed.
Something went wrong: {error.message} Reconnected. Catching up.
#### Javascript
```
import { useTransportStatus } from '@ably/ai-transport/react';
function Status() {
const { discontinuity, error } = useTransportStatus();
if (error) return
This hook must be used within a [`TransportProvider`](https://ably.com/docs/ai-transport/api/react/transport-provider.md).
To read whether the channel is attached, use `useChannelStateListener` from `ably/react`, which works inside the provider.
`discontinuity` stays `true` once it is set. To recover after every discontinuity, listen with `transport.on('discontinuity')` and subscribe again from the serial of the last message you received, as the [example](#example) shows.
## Parameters
### Javascript
```
import { useEffect, useRef } from 'react';
import { fromSerial } from '@ably/ai-transport';
import { useTransport, useTransportStatus } from '@ably/ai-transport/react';
function Conversation({ storedSerial, render }) {
const { transport } = useTransport();
const { discontinuity } = useTransportStatus();
const lastSeen = useRef(storedSerial);
useEffect(() => {
if (!transport) return;
const apply = (delivery) => {
render(delivery);
if (delivery.message.serial > lastSeen.current) lastSeen.current = delivery.message.serial;
};
const subscribeFrom = (serial) => transport.subscribe(apply, serial ? { history: { replay: fromSerial(serial) } } : undefined);
let unsubscribe = subscribeFrom(lastSeen.current);
const off = transport.on('discontinuity', () => {
unsubscribe();
unsubscribe = subscribeFrom(lastSeen.current);
});
return () => {
off();
unsubscribe();
};
}, [transport, render]);
return discontinuity ? Reconnected.
: null;
}
```
## Related Topics
- [TransportProvider](https://ably.com/docs/ai-transport/api/react/transport-provider.md): API reference for the AI Transport TransportProvider: create a transport for a channel and make it available to React components.
- [useTransport](https://ably.com/docs/ai-transport/api/react/use-transport.md): API reference for the AI Transport useTransport hook: read the transport from the nearest or a named TransportProvider.
- [useDeliveries](https://ably.com/docs/ai-transport/api/react/use-deliveries.md): API reference for the AI Transport useDeliveries hook: receive every delivery on the transport's channel while a component is mounted.
- [useHistory](https://ably.com/docs/ai-transport/api/react/use-history.md): API reference for the AI Transport useHistory hook: read the channel's history one page at a time, oldest first.
## Documentation Index
To discover additional Ably documentation:
1. Fetch [llms.txt](https://ably.com/llms.txt) for the canonical list of available pages.
2. Identify relevant URLs from that index.
3. Fetch target pages as needed.
Avoid using assumed or outdated documentation paths.