I'm writing simple app using React / Redux. I notice that function mapStateToProps() is called many times. Here`s code:
class Employees extends React.Component {
componentDidMount() {
this.props.fetchEmployees();
}
}
let mapStateToProps = function mapStateToProps(state) {
console.log("foo");
return {...};
};
let mapDispatch = (dispatch) => {
return {
fetchEmployees: bindActionCreators(fetchEmployees, dispatch)
};
};
export default connect(mapStateToProps, mapDispatch)(Employees);
And what I get in console:
Is it normal or I'm doing something wrong?
