Using React, I want to get an audio element.
var AudioPlayer = React.createClass({ componentDidMount: function () { console.info('Audio: component did mount'); var audio = React.findDOMNode('audio'); console.info('audio', audio); }, render : function() { return ( <audio src="/static/music/foo.mp3" controls /> ); } });
But I get an error all the time:
Error: Invariant violation: the element is neither ReactComponent nor DOMNode (keys: 0,1,2,3,4)
Undoubtedly, are React classes lowered components?
source share