# useNotificationTarget

`useNotificationTarget` returns the panel that the calling component lives in. It inspects React context (`ChannelContext`, `ThreadContext`, `ThreadsContext`, `ChannelsContext`) and returns the matching panel string. Use it in custom notification UI when you need the panel name; the default snackbar routing uses `NotificationTargetProvider` for exact host targeting.

## Usage

```tsx
import { useNotificationTarget } from "stream-chat-react-native";

const panel = useNotificationTarget();
// → 'channel' | 'thread' | 'channel-list' | 'thread-list' | undefined
```

## Returns

`NotificationTargetPanel | undefined`. The panel is resolved as follows, in order:

| Condition                                                            | Panel            |
| -------------------------------------------------------------------- | ---------------- |
| Mounted inside a `Channel` with `threadList` set on `ChannelContext` | `'thread'`       |
| Mounted inside a `Thread` with a `threadInstance` on `ThreadContext` | `'thread'`       |
| Mounted inside a `Channel` with a `channel` on `ChannelContext`      | `'channel'`      |
| Mounted inside a `ThreadList` with `ThreadsContext` present          | `'thread-list'`  |
| Mounted inside a `ChannelList` with `ChannelsContext` present        | `'channel-list'` |
| None of the above                                                    | `undefined`      |

The first matching condition wins.

If you need to disambiguate between multiple instances of the same panel (e.g. two thread views on the same screen), wrap the subtree in [`NotificationTargetProvider`](/chat/docs/sdk/react-native/ui-components/in-app-notifications/notification-target-context/) with a stable `hostId`.


---

This page was last updated at 2026-05-14T07:09:01.212Z.

For the most recent version of this documentation, visit [https://getstream.io/chat/docs/sdk/react-native/ui-components/in-app-notifications/hooks/use-notification-target/](https://getstream.io/chat/docs/sdk/react-native/ui-components/in-app-notifications/hooks/use-notification-target/).