Minor: remove a typecast from <CallingPip>

This commit is contained in:
Evan Hahn 2020-12-01 10:57:46 -06:00 committed by GitHub
parent 4c78a6c57f
commit c7290309d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 11 deletions

View file

@ -38,7 +38,7 @@ export const CallingPip = ({
setRendererCanvas, setRendererCanvas,
togglePip, togglePip,
}: PropsType): JSX.Element | null => { }: PropsType): JSX.Element | null => {
const videoContainerRef = React.useRef(null); const videoContainerRef = React.useRef<null | HTMLDivElement>(null);
const localVideoRef = React.useRef(null); const localVideoRef = React.useRef(null);
const [dragState, setDragState] = React.useState({ const [dragState, setDragState] = React.useState({
@ -144,7 +144,7 @@ export const CallingPip = ({
if (!node) { if (!node) {
return; return;
} }
const rect = (node as HTMLElement).getBoundingClientRect(); const rect = node.getBoundingClientRect();
const offsetX = ev.clientX - rect.left; const offsetX = ev.clientX - rect.left;
const offsetY = ev.clientY - rect.top; const offsetY = ev.clientY - rect.top;

View file

@ -14423,15 +14423,6 @@
"updated": "2020-10-26T19:12:24.410Z", "updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Used to get the local video element for rendering." "reasonDetail": "Used to get the local video element for rendering."
}, },
{
"rule": "React-useRef",
"path": "ts/components/CallingPip.tsx",
"line": " const videoContainerRef = React.useRef(null);",
"lineNumber": 41,
"reasonCategory": "usageTrusted",
"updated": "2020-10-26T19:12:24.410Z",
"reasonDetail": "Element is measured. Its HTML is not used."
},
{ {
"rule": "React-useRef", "rule": "React-useRef",
"path": "ts/components/CallingPip.tsx", "path": "ts/components/CallingPip.tsx",