React - play media after items are loaded with array.map()
问题 I'm using react-player to render youtube videos with map() , like so: class Jukebox extends Component { constructor (props) { super(props); this.state = { youtube_urls:[], clients:[], }; }; componentDidMount() { if (this.props.isAuthenticated) { this.getItems(); } }; getItems(event) { const {userId} = this.props const options = { url: `${process.env.REACT_APP_WEB_SERVICE_URL}/jukebox/${userId}`, method: 'get', headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': true,