Skip to content
Snippets Groups Projects
Commit bc09077d authored by joshrandall8478's avatar joshrandall8478
Browse files

fixed null error

parent 5900b03c
Branches
No related tags found
No related merge requests found
......@@ -58,9 +58,9 @@ function App() {
const [videoIndex, setVideoIndex] = useState(1);
const currentVideoRef = useRef(filteredArray[0]);
const currentVideoRef = useRef(filteredArray[0] || '');
useEffect(() => {
currentVideoRef.current = filteredArray[videoIndex];
currentVideoRef.current = filteredArray[videoIndex] || '';
}, [videoIndex]);
// function initializeVideoRef(){
......@@ -89,7 +89,7 @@ function App() {
<h2><div>
<ReactPlayer
id = "video"
url={currentVideoRef.current}
url={currentVideoRef.current || ''}
playing={true}
muted={true}
controls={true}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment