Guest User

Untitled

a guest
Jan 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. import React, { Component } from 'react';
  2. import { connect } from 'react-redux';
  3.  
  4. import { requestSomething } from '../actions/compActions';
  5.  
  6. class Comp1 extends Component {
  7. componentDidMount() {
  8. this.props.requestSomething();
  9. }
  10. render() {
  11. const {
  12. some
  13. } = this.props;
  14.  
  15. return (
  16. <section className="">
  17.  
  18. </section>
  19. )
  20. }
  21. }
  22.  
  23. const mapStateToProps = (state) => {
  24. return {
  25. some: state.some,
  26. }
  27. }
  28.  
  29. const mapDispatchToProps = (dispatch) => {
  30. return {
  31. requestSomething: () => dispatch(requestSomething()),
  32. }
  33. }
  34.  
  35.  
  36. export default connect(mapStateToProps, mapDispatchToProps)(Comp1)
Add Comment
Please, Sign In to add comment