You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 15, 2022. It is now read-only.
11:48
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function. bug error
intent
I want to use the modal-box to play the video by clicking on the video-image list. So I wrote openVideoFunc to switch video-URL and show/hide modal-box.
code (In order to facilitate reading, part of the code has been simplified (style, etc.))
// Require local imgconstimage1=require('./assets/img/1.jpg')constimage2=require('./assets/img/2.jpg')// Require local videoconstvideo1=require('./assets/video/1.mp4')constvideo2=require('./assets/video/2.mp4')// array object for img/videoconstvideoRes=[{"videoId": 1,"videoUrl": video1,"posterUrl": image1,"title": "test1","describe": "test1......"},...]exportdefaultfunctionApp(){const[visible,setVisible]=React.useState(false);const[videoUrl,setVideoUrl]=React.useState(null)// Video Poster ListconstlistItems=videoRes.map(item=><TouchableOpacityonPress={()=>openVideoFunc(item)}key={item.videoId}><Layout><Imagesource={item.posterUrl}/></Layout></TouchableOpacity>)//open video funcconstopenVideoFunc=(item)=>{setVideoUrl(item.videoUrl)//Switch video urlsetVisible(true)//open modal}return(<Layout>{listItems}<Modalvisible={visible}><ButtononPress={()=>setVisible(false)}/> //close modalbox
<VideoPlayersource: videoUrl/> //videoplayer
</Modal></Layout>);}
bug
11:48
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
bug error
intent
I want to use the
modal-box
to play the video by clicking on the video-image list. So I wroteopenVideoFunc
to switchvideo-URL
and show/hidemodal-box
.code (In order to facilitate reading, part of the code has been simplified (style, etc.))
version-Information
"expo-cli": 4.0.13
"expo": "^40.0.0",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "40.0.0",
The text was updated successfully, but these errors were encountered: