> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Transfer Ownership

> Transfer Ownership — CometChat documentation.

## Overview

`CometChatTransferOwnership` is a [Component](/ui-kit/react-native/v4/components-overview#components) that allows the current owner or administrator of a group to transfer the ownership rights and administrative control of that group to another user. By transferring ownership, the original owner can designate a new user as the group owner, giving them full control and administrative privileges over the group.

Here are some key points regarding the transfer ownership feature in CometChat:

1. Administrative Control: The current owner or administrator of the group has the authority to initiate the transfer of ownership. This feature is typically available to ensure flexibility and allow smooth transitions of group ownership.
2. New Group Owner: During the transfer process, the current owner can select a specific user from the group members to become the new owner. This new owner will then assume the responsibilities and privileges associated with being the group owner.
3. Administrative Privileges: As the new owner, the designated user will gain full administrative control over the group. They will have the ability to manage group settings, add or remove members, moderate conversations, and perform other administrative actions.
4. Group Continuity: Transferring ownership does not disrupt the existing group or its content. The transfer ensures the continuity of the group while transferring the administrative control to a new owner.

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b/y8uIEcRYKgfQIY6z/images/9e51e88c-transfer_overview_cometchat_screens-b7ef48a82f459c34e1e39e51015376b0.png?fit=max&auto=format&n=y8uIEcRYKgfQIY6z&q=85&s=edf812fe9db48730025c0e010c45fa0c" alt="Image" width="4498" height="3120" data-path="images/9e51e88c-transfer_overview_cometchat_screens-b7ef48a82f459c34e1e39e51015376b0.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b/8YlylzCf9CehSaWO/images/c8fa4e39-transfer_overview_cometchat_screens-38a8dd75a36193fc3a71b8c5e0dec33d.png?fit=max&auto=format&n=8YlylzCf9CehSaWO&q=85&s=892ee30ec0d3cc2ec8c8671bcbc903b6" alt="Image" width="4498" height="3120" data-path="images/c8fa4e39-transfer_overview_cometchat_screens-38a8dd75a36193fc3a71b8c5e0dec33d.png" />
  </Tab>
</Tabs>

***

## Usage

### Integration

The following code snippet illustrates how you can directly incorporate the Transfer Ownership component into your Application.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatTransferOwnership } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      return (
        <>
          {group && (
            <CometChatTransferOwnership group={group}></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***

### Actions

[Actions](/ui-kit/react/components-overview#actions) dictate how a component functions. They are divided into two types: Predefined and User-defined. You can override either type, allowing you to tailor the behavior of the component to fit your specific needs.

##### 1. onTransferOwnership

The `onTransferOwnership` action is activated when you make a selection and press the done icon. This action takes place after the ownership has been transferred.

This action does not come with any predefined behavior. However, you have the flexibility to override this event and tailor it to suit your needs using the following code snippet.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatTransferOwnership } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const onTransferOwnershipHandler = (
        group: CometChat.Group,
        ownershipTransferredMember: CometChat.User
      ) => {
        //code
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              onTransferOwnership={onTransferOwnershipHandler}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 2. OnBack

`OnBack` is triggered when you click on the back button of the Transfer Ownership component. You can override this action using the following code snippet.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatTransferOwnership } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const onBackHandler = () => {
        //code
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              onBack={onBackHandler}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 3. onError

This action doesn't change the behavior of the component but rather listens for any errors that occur in the Transfer Ownership component.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatTransferOwnership } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const onErrorHandler = (error: CometChat.CometChatException) => {
        //code
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              onError={onErrorHandler}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***

### Filters

**Filters** allow you to customize the data displayed in a list within a Component. You can filter the list based on your specific criteria, allowing for a more customized. Filters can be applied using RequestBuilders of Chat SDK.

##### 1. GroupMembersRequestBuilder

The [GroupMembersRequestBuilder](/sdk/react-native/retrieve-group-members) enables you to filter and customize the group members list based on available parameters in GroupMembersRequestBuilder. This feature allows you to create more specific and targeted queries when fetching groups. The following are the parameters available in [GroupMembersRequestBuilder](/sdk/react-native/retrieve-group-members)

| Methods              | Type           | Description                                                                                       |
| -------------------- | -------------- | ------------------------------------------------------------------------------------------------- |
| **setLimit**         | number         | sets the number of group members that can be fetched in a single request, suitable for pagination |
| **setSearchKeyword** | string         | used for fetching group members matching the passed string                                        |
| **setScopes**        | Array\<string> | used for fetching group members based on multiple scopes                                          |

**Example**

In the example below, we are applying a filter to the Group Members by setting the limit to two and setting the scope to show only admin and moderator.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatTransferOwnership } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);
      let groupMemberRequestBuilder;

      const getGroup = async () => {
        const group = await CometChat.getGroup("mrc-uid");
        groupMemberRequestBuilder = new CometChat.GroupMembersRequestBuilder(
          group.getGuid()
        ).setScopes(["admin"]);
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const onErrorHandler = (error: CometChat.CometChatException) => {
        //code
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              groupMemberRequestBuilder={groupMemberRequestBuilder}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 2. SearchRequestBuilder

The SearchRequestBuilder uses [GroupMembersRequestBuilder](/sdk/react-native/retrieve-group-members) enables you to filter and customize the search list based on available parameters in GroupMembersRequestBuilder. This feature allows you to keep uniformity between the displayed Group Members List and searched Group Members List.

**Example**

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatTransferOwnership } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);
      let searchRequestBuilder;

      const getGroup = async () => {
        const group = await CometChat.getGroup("mrc-uid");
        searchRequestBuilder = new CometChat.GroupMembersRequestBuilder(
          group.getGuid()
        )
          .setScopes(["admin"])
          .setSearchKeyword("some-search-keyword");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              groupMemberRequestBuilder={searchRequestBuilder}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***

***

### Events

[Events](/ui-kit/react/components-overview#events) are emitted by a `Component`. By using event you can extend existing functionality. Being global events, they can be applied in Multiple Locations and are capable of being Added or Removed.

Events emitted by the Add Members component is as follows.

| Event                  | Description                                                   |
| ---------------------- | ------------------------------------------------------------- |
| **ccOwnershipChanged** | Triggers when the group ownership is successfully transferred |

<Tabs>
  <Tab title="Adding Listeners">
    ```tsx theme={null}
    import { CometChatUIEventHandler } from "@cometchat/chat-uikit-react-native";

    CometChatUIEventHandler.addGroupListener("GROUP_LISTENER_ID", {
      ccOwnershipChanged: ({ group, message }) => {
        //code
      },
    });
    ```
  </Tab>
</Tabs>

***

<Tabs>
  <Tab title="Removing Listeners">
    ```tsx theme={null}
    import { CometChatUIEventHandler } from "@cometchat/chat-uikit-react-native";

    CometChatUIEventHandler.removeGroupListener("GROUP_LISTENER_ID");
    ```
  </Tab>
</Tabs>

***

## Customization

To fit your app's design requirements, you can customize the appearance of the Groups component. We provide exposed methods that allow you to modify the experience and behavior according to your specific needs.

### Style

Using **Style** you can **customize** the look and feel of the component in your app, These parameters typically control elements such as the **color**, **size**, **shape**, and **fonts** used within the component.

##### 1. GroupMember Style

You can set the `GroupMemberStyle` to the Transfer Ownership Component to customize the styling. For further insights on `GroupMember` Styles [refer](/ui-kit/react-native/v4/group-members)

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatTransferOwnership,
      GroupMembersStyleInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("mrc-uid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const groupMemberStyle: GroupMembersStyleInterface = {
        titleColor: "red",
        backgroundColor: "#d2cafa",
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              groupMemberStyle={groupMemberStyle}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 2. Avatar Style

To apply customized styles to the `Avatar` component in the Banned Members Component, you can use the following code snippet. For further insights on `Avatar` Styles [refer](/ui-kit/react-native/v4/avatar)

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatTransferOwnership,
      AvatarStyleInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("mrc-uid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const avatarStyle: AvatarStyleInterface = {
        outerViewSpacing: 5,
        outerView: {
          borderWidth: 2,
          borderStyle: "dotted",
          borderColor: "blue",
        },
        border: borderStyle,
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              avatarStyle={avatarStyle}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 3. ListItem Style

To apply customized styles to the `ListItemStyle` component in the `Banned Members` Component, you can use the following code snippet. For further insights on `ListItemStyle` Styles [refer](/ui-kit/react-native/v4/list-item)

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatTransferOwnership,
      ListItemStyleInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const listItemStyle: ListItemStyleInterface = {
        titleColor: "red",
        backgroundColor: "#d2cafa",
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              listItemStyle={listItemStyle}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

##### 4. StatusIndicator Style

To apply customized styles to the Status Indicator component in the Banned Members Component, You can use the following code snippet. For further insights on Status Indicator Styles [refer](/ui-kit/react-native/v4/status-indicator)

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import {
      CometChatTransferOwnership,
      StatusIndicatorStyleInterface,
    } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const statusIndicatorStyle: StatusIndicatorStyleInterface = {
        backgroundColor: "grey",
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              statusIndicatorStyle={statusIndicatorStyle}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***

### Functionality

These are a set of small functional customizations that allow you to fine-tune the overall experience of the component. With these, you can change text, set custom icons, and toggle the visibility of UI elements.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatTransferOwnership } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              title="Custom Title"
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b/7-hZ4AEh99NJJtEC/images/97a9000f-transfer_func_cometchat_screens-4c8343648b28f592f9d0780517fe2d6c.png?fit=max&auto=format&n=7-hZ4AEh99NJJtEC&q=85&s=dd38069e6d24a47734cdb92261716591" alt="Image" width="4498" height="3120" data-path="images/97a9000f-transfer_func_cometchat_screens-4c8343648b28f592f9d0780517fe2d6c.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b/qrEt0CwYkpwR_jD-/images/d859b183-transfer_func_cometchat_screens-10c03363e0d17b50cc81264c192d81cd.png?fit=max&auto=format&n=qrEt0CwYkpwR_jD-&q=85&s=929ea73c439eba431fc63c3837c7d11b" alt="Image" width="4498" height="3120" data-path="images/d859b183-transfer_func_cometchat_screens-10c03363e0d17b50cc81264c192d81cd.png" />
  </Tab>
</Tabs>

***

### Advance

For advanced-level customization, you can set custom views to the component. This lets you tailor each aspect of the component to fit your exact needs and application aesthetics. You can create and define your views, layouts, and UI elements and then incorporate those into the component.

***

#### ListItemView

With this property, you can assign a custom `ListItemView` to the Transfer Ownership Component.

**Example**

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b/v4EbHQCGZ54oJcmr/images/5af848ad-transfer_list_item_view_cometchat_screens-cf04b922059aefba9ea0bad41c5d326a.png?fit=max&auto=format&n=v4EbHQCGZ54oJcmr&q=85&s=d7bd2c3646fa144815165093d741ca19" alt="Image" width="4498" height="3120" data-path="images/5af848ad-transfer_list_item_view_cometchat_screens-cf04b922059aefba9ea0bad41c5d326a.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b/LKT8U_07JOWQgTZK/images/0da4dab6-transfer_list_item_view_cometchat_screens-790e299fc7cf76888ff47094a89846dd.png?fit=max&auto=format&n=LKT8U_07JOWQgTZK&q=85&s=ad3c58c79dc99a11a7fc635996d49a98" alt="Image" width="4498" height="3120" data-path="images/0da4dab6-transfer_list_item_view_cometchat_screens-790e299fc7cf76888ff47094a89846dd.png" />
  </Tab>
</Tabs>

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatTransferOwnership } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const viewStyle: StyleProp<ViewStyle> = {
        flex: 1,
        flexDirection: "row",
        alignItems: "flex-start",
        padding: 10,
        borderColor: "black",
        borderWidth: 1,
        backgroundColor: "#E8EAE9",
        borderRadius: 10,
        margin: 2,
      };

      const getListItemView = (user: any) => {
        return (
          <View style={viewStyle}>
            <CometChatAvatar
              image={user.avatar ? { uri: user.avatar } : undefined}
              name={user.name}
            />

            <View>
              <Text style={{ color: "black", fontWeight: "bold" }}>
                {user.name}
              </Text>
              <Text style={{ color: "#667" }}>{user.status}</Text>
            </View>
          </View>
        );
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              title="Custom Title"
              ListItemView={getListItemView}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***

#### SubtitleView

You can customize the `SubtitleView` view for each banned members to meet your requirements

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b/Mh-tK73gC5erLrBQ/images/f42fbfa9-transfer_subtitle_view_cometchat_screens-30fb6d4cdb2c20bf1569daaa2cefe0e5.png?fit=max&auto=format&n=Mh-tK73gC5erLrBQ&q=85&s=2c0d8e2333d728dc67eeef8f210cc49b" alt="Image" width="4498" height="3120" data-path="images/f42fbfa9-transfer_subtitle_view_cometchat_screens-30fb6d4cdb2c20bf1569daaa2cefe0e5.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b/bUk-WwSNpBXF92Yc/images/dac6b4ef-transfer_subtitle_view_cometchat_screens-befe0f901ad74da4ed322ff92e54fb7a.png?fit=max&auto=format&n=bUk-WwSNpBXF92Yc&q=85&s=db25e765bbeb39d96b0e65baca7c2c33" alt="Image" width="4498" height="3120" data-path="images/dac6b4ef-transfer_subtitle_view_cometchat_screens-befe0f901ad74da4ed322ff92e54fb7a.png" />
  </Tab>
</Tabs>

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatTransferOwnership } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const getSubtitleView = (user) => {
        return (
          <Text
            style={{
              fontSize: 12,
              color: theme.palette.getAccent800(),
            }}
          >
            Last Active At:{" "}
            {user?.lastActiveAt ? formatTime(user?.lastActiveAt) : "--"}
          </Text>
        );
      };

      const getSubtitleView = (user) => {
        return (
          <Text
            style={{
              fontSize: 12,
              color: theme.palette.getAccent800(),
            }}
          >
            Last Active At:{" "}
            {user?.lastActiveAt ? formatTime(user?.lastActiveAt) : "--"}
          </Text>
        );
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              SubtitleView={getSubtitleView}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

#### LoadingStateView

You can set a custom loader view using `LoadingStateView` to match the loading view of your app.

<Tabs>
  <Tab title="iOS">
    <img src="https://mintcdn.com/cometchat-22654f5b/_oiGBuX1qG3S8Eo5/images/622b5dc6-transfer_loading_state_view_cometchat_screens-0fce6ce22622a21bfbf29c37d78c2f91.png?fit=max&auto=format&n=_oiGBuX1qG3S8Eo5&q=85&s=bc3b77930714089d3ffc140dfc4aa1f7" alt="Image" width="4498" height="3120" data-path="images/622b5dc6-transfer_loading_state_view_cometchat_screens-0fce6ce22622a21bfbf29c37d78c2f91.png" />
  </Tab>

  <Tab title="Android">
    <img src="https://mintcdn.com/cometchat-22654f5b/veBAxaR1km9EBnSg/images/3c146cf4-transfer_loading_state_view_cometchat_screens-5b28dcdc7c033b03a92f291d801abce8.png?fit=max&auto=format&n=veBAxaR1km9EBnSg&q=85&s=9dbb466dff88d7ec993fe31e7cd38473" alt="Image" width="4498" height="3120" data-path="images/3c146cf4-transfer_loading_state_view_cometchat_screens-5b28dcdc7c033b03a92f291d801abce8.png" />
  </Tab>
</Tabs>

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatTransferOwnership } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const loadingViewStyle: StyleProp<ViewStyle> = {
        flex: 1,
        alignItems: "center",
        justifyContent: "center",
        padding: 10,
        borderColor: "black",
        borderWidth: 1,
        backgroundColor: "#E8EAE9",
      };

      const getLoadingStateView = () => {
        return (
          <View style={loadingViewStyle}>
            <Text style={{ fontSize: 20, color: "black" }}>Loading...</Text>
          </View>
        );
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              LoadingStateView={getLoadingStateView}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

#### EmptyStateView

You can set a custom `EmptyStateView` using `EmptyStateView` to match the empty view of your app.

<Tabs>
  <Tab title="App.tsx">
    ```tsx theme={null}
    import { CometChat } from "@cometchat/chat-sdk-react-native";
    import { CometChatTransferOwnership } from "@cometchat/chat-uikit-react-native";

    function App(): React.JSX.Element {
      const [group, setGroup] = useState<CometChat.Group | undefined>(undefined);

      const getGroup = async () => {
        const group = await CometChat.getGroup("guid");
        setGroup(group);
      };

      useEffect(() => {
        //login
        getGroup();
      });

      const searchRequestBuilder = new CometChat.UsersRequestBuilder()
        .setLimit(100)
        .setSearchKeyword("does-not-exist");

      const emptyViewStyle: StyleProp<ViewStyle> = {
        flex: 1,
        alignItems: "center",
        justifyContent: "center",
        padding: 10,
        borderColor: "black",
        borderWidth: 1,
        backgroundColor: "#E8EAE9",
      };

      const getEmptyStateView = () => {
        return (
          <View style={emptyViewStyle}>
            <Text style={{ fontSize: 80, color: "black" }}>Empty</Text>
          </View>
        );
      };

      return (
        <>
          {group && (
            <CometChatTransferOwnership
              group={group}
              searchRequestBuilder={searchRequestBuilder}
              EmptyStateView={getEmptyStateView}
            ></CometChatTransferOwnership>
          )}
        </>
      );
    }
    ```
  </Tab>
</Tabs>

***
