I created React Component using the following code. In this, I create a tab and add a class and save its link in the global namespace interface for further processing.
var TabBody = React.createClass({
getInitialState: function() {
return {
class: 'tabBody tab activeTab'
}
},
render: function() {
Interfaces.tabBody = this;
tabSelectionInfo.tabBody = this;
return (
React.createElement('div', {
className: this.state.class,
onClick: handleTabClick
},
React.createElement('span', {}, "Body"))
);
}
});
using the following function: To add a class to the above component, the console displays an undefined error. how to maintain redundancy of this component, then to change its class.
handleTabClick = function() {
Interfaces.tabBody.classList.add('tabPreviewComplete');
}
source
share