In react, the video element is obtained through createRef, and the first print is null?

export default class TrailResult extends Component {
constructor () {

super()
this.video = React.createRef()

}
}

showVideo = () = > {
const video = this.video.current
console.log (this.video)
}

render () {
return (
< video ref= {this.video} style= {{width: "600px"}} >
Video Test
< / video >)
}

Sorry, I don"t know how to adjust the code format for the first time. Try

first.
Jun.20,2022
Menu