Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React, { Component } from 'react';
- import { connect } from 'react-redux';
- import { requestSomething } from '../actions/compActions';
- class Comp1 extends Component {
- componentDidMount() {
- this.props.requestSomething();
- }
- render() {
- const {
- some
- } = this.props;
- return (
- <section className="">
- </section>
- )
- }
- }
- const mapStateToProps = (state) => {
- return {
- some: state.some,
- }
- }
- const mapDispatchToProps = (dispatch) => {
- return {
- requestSomething: () => dispatch(requestSomething()),
- }
- }
- export default connect(mapStateToProps, mapDispatchToProps)(Comp1)
Add Comment
Please, Sign In to add comment