for adding/removing css classes, you could do something like this:
render() {
return <div className={ getClassName() }>...</div>;
}
Where getClassName() calculates the value based on current state/props. Can also do this for style:
render() {
const { opacity, color } = this.state;
return <div style={{ opacity, color }}>...</div>;
}
For event listeners you'd generally use the built-in handlers e.g. onClick. But sometimes you need to work outside the box. e.g.
componentDidMount() {
$(ref).someJQueryPlugin({ /* options */ });
}
componentWillUnmount() {
// Dispose of side effect caused by plugin
}