# Component view screen size changes while screen sharing

**URL:** <https://devforum.zoom.us/t/component-view-screen-size-changes-while-screen-sharing/107697>\
**Category:** Meeting SDK\
**Created:** [April 11, 2024, 1:00pm UTC](https://devforum.zoom.us/t/component-view-screen-size-changes-while-screen-sharing/107697 "2024-04-11T13:00:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajan1](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/rajan1/32/58566_2.png) [@rajan1](https://devforum.zoom.us/u/rajan1)\
**Post date:** [April 11, 2024, 1:00pm UTC](https://devforum.zoom.us/t/component-view-screen-size-changes-while-screen-sharing/107697/1 "2024-04-11T13:00:20Z")

</div>

While screen sharing using component view in our react application screen size changes.

CODE:  
const getZoomViewSizes = () =\> {  
if (width \> 980) {  
return { width: 752, height: 424 };  
} else if (width \> 688) {  
return { width: 560, height: 316 };  
}  
return { width: 358, height: 201 };  
};

function startMeeting(signature) {  
setShowJoinMeeting(false);  
const client = ZoomMtgEmbedded.createClient();  
const meetingSDKElement = document.getElementById(‘meetingSDKElement’);

```
const joinConfig = {
  signature: signature,
  sdkKey: config.zoom.SDK_KEY,
  meetingNumber: meeting_id,
  password: meeting_pwd,
  userName: kimo.name,
};
if (kimo.email) {
  joinConfig['userEmail'] = kimo.email;
}

client
  .init({
    zoomAppRoot: meetingSDKElement,
    language: 'en-US',
    patchJsMedia: true,

    customize: {
      video: {
        viewSizes: { default: getZoomViewSizes() },
        isResizable: true,
      },
    },
  })
  .then(() => {
    client
      .join(joinConfig)
      .then(() => {
        console.log('joined successfully');
      })
      .catch((error) => {
        console.log(error);
      });
  })
  .catch((error) => {
    console.log(error);
  });

```

}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [April 15, 2025, 4:36am UTC](https://devforum.zoom.us/t/component-view-screen-size-changes-while-screen-sharing/107697/2 "2025-04-15T04:36:26Z")

</div>

This topic was automatically closed 368 days after the last reply. New replies are no longer allowed.
