Skip to content

Instantly share code, notes, and snippets.

@smhatre59
Created November 5, 2016 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smhatre59/fc7bae69b4ed7a9621d90374bdc176b2 to your computer and use it in GitHub Desktop.
Save smhatre59/fc7bae69b4ed7a9621d90374bdc176b2 to your computer and use it in GitHub Desktop.
import React from "react";
import ReactDOM from "react-dom";
import {connect} from "react-redux";
import UserList from './UserList.js'
import {fetchUsers} from "../actions/userActions.js"
@connect((store) => {
// console.log("ins store",store.userReducer.users);
return {
users: store.userReducer.users
}
})
export default class Main extends React.Component{
componentWillMount(){
this.props.dispatch(fetchUsers());
}
render(){
console.log(this.props.users);
return (
<div>
<UserList users ={this.props.users}/>
</div>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment