I have five buttons, dynamically created. My target is: when any button is clicked to add active class to it, and of course if any other has that active class to remove it.
You need to introduce state to your component and set it in onClick event handler. For example output of render method:
onClick
{buttons.map(function (name, index) { return this.someFunct(name)} key={ name } />; })}
event handler (element method):
someFunct(name) { this.setState({ active: name }) }