简体   繁体   中英

Can anybody explain this JS code inside the audio tag?

I'm creating a React app. While looking at this example: https://codepen.io/freeCodeCamp/pen/XpKrrW?editors=0010 I found a peculiar way to manage the audio tag at lines 211 - 213. Can anybody explain to me what the author is doing here?

I looked at the documentation: https://www.w3schools.com/tags/tag_audio.asp but ref isn't even in the default properties.

<audio id="beep" preload="auto" 
    src="<<audio url>>"
    ref={(audio) => { this.audioBeep = audio; }} />

这是一个react属性,请检查此ref函数

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM