The path is: imports/ui/components/Events.js
The content of the component file is
import React from 'react';
import { connect } from 'react-redux';
import { changeText } from '../redux/actions';
class Events extends React.Component {
constructor(props) {
super(props);
this.text = props.text;
this.onClick = props.onClick;
}
render() {
return (
<div className="events-container">
<h2>Events</h2>
<a onClick={this.onClick}>Click Me</a>
<h3>{this.text}</h3>
</div>
);
}
}
const mapStateToProps = (state) => {
return {
text: state.eventsReducer.text
}
}
const mapDispatchToProps = (dispatch) => {
return {
onClick: () => {
dispatch(changeText())
}
}
}
export default connect(mapStateToProps, mapDispatchToProps)(Events);