I'm curious about the best approach for accessing DOM elements within my render function from the same component. It's important to keep in mind that this component will be rendered multiple times on a single page.
For example:
var ToDoItem = React.createClass({
...
render: function() {
function oneSecondLater() {
setTimeout(function(){
// Selecting the current className? This code snippet is not functional, but illustrates what I am trying to achieve.
document.getElementsByClassName('name').style.backgroundColor = "red";
}, 1000);
}
return (
<div className='name'>{this.oneSecondLater}</div>
);
}
});