Skip to content

Commit

Permalink
useExhaustiveDependencies を有効にする
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Nov 22, 2023
1 parent 0f838b9 commit c373798
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
3 changes: 0 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
"enabled": true,
"rules": {
"all": true,
"correctness": {
"useExhaustiveDependencies": "off"
},
"style": {
"useNamingConvention": "off"
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/AlertMessages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Reconnect: React.FC = () => {
}
useEffect(() => {
dispatch(reconnectSora())
}, [])
}, [dispatch])
return (
<Toast delay={20000} onClose={onClose}>
<Toast.Header className={'bg-warning text-white'}>
Expand Down
5 changes: 3 additions & 2 deletions src/components/Video/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const VideoElement: React.FC<VideoProps> = (props) => {
const { displayResolution, stream, mute, audioOutput, setHeight } = props
const videoRef = useRef<CustomHTMLVideoElement>(null)
const videoSize = getVideoSizeByResolution(displayResolution)

useEffect(() => {
const resizeObserver = new ResizeObserver((entries: ResizeObserverEntry[]) => {
entries.filter((entry) => {
Expand All @@ -30,7 +31,7 @@ const VideoElement: React.FC<VideoProps> = (props) => {
return () => {
resizeObserver.disconnect()
}
}, [])
}, [setHeight, audioOutput, stream])

useEffect(() => {
if (videoRef.current && mute) {
Expand Down Expand Up @@ -63,7 +64,7 @@ const VideoElement: React.FC<VideoProps> = (props) => {
} else if (videoRef.current && stream === null) {
videoRef.current.srcObject = null
}
}, [stream])
}, [stream, audioOutput])

if (audioOutput && videoRef.current?.setSinkId && stream && stream.getAudioTracks().length > 0) {
videoRef.current.setSinkId(audioOutput)
Expand Down
2 changes: 1 addition & 1 deletion src/pages/devtools.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const Devtools: React.FC = () => {
return () => {
dispatch(disconnectSora())
}
}, [])
}, [dispatch])
return (
<>
<MediacaptureRegionTarget />
Expand Down

0 comments on commit c373798

Please sign in to comment.