Created
November 5, 2016 07:29
-
-
Save smhatre59/fc7bae69b4ed7a9621d90374bdc176b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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