【问题标题】:TypeError: Cannot read properties of undefined (reading 'video')TypeError:无法读取未定义的属性(读取“视频”)
【发布时间】:2022-01-03 08:02:15
【问题描述】:
    import { ArrowBackOutlined } from "@material-ui/icons";
 import { Link, useLocation } from "react-router-dom"; import 
"./watch.scss";

export default function Watch() { const location = useLocation(); 
const movie = location.movie; return ( Home <video className="video" 
autoPlay progress controls src={ movie.video } /> ); }

我尝试使用 useLocation 让它显示来自数据库的视频,但它给了我一个错误,提示“视频”未定义

【问题讨论】:

    标签: node.js reactjs video undefined mern


    【解决方案1】:

    我们开始吧:

    autoPlay progress controls src={ movie?.video } /> ); }
    

    来源:VideoWebsite

    【讨论】:

      猜你喜欢
      • 2021-11-26
      • 2021-11-24
      • 2021-12-20
      • 2021-11-27
      • 2022-01-21
      • 2021-12-04
      • 2021-12-09
      • 2021-12-06
      • 2022-01-13
      相关资源
      最近更新 更多