received data from react-redux

338
March 08, 2017, at 11:53 PM

I have trouble with received data.

I create actions with axios and know this is working well, Have promise with status 200 and GET.

Then i want initial function HandleClick on button onClick, on my container fetch_users, so i create new container :

class FetchUsers extends Component {
  constructor(props) {
    super(props);
    this.handleClick = this.handleClick.bind(this);
  }
  handleClick(e) {
    e.preventDefault();
    console.log('thisporps', this.props)
    this.props.fetchUsers()
    console.log('this.props.fetchUSers')
  }
render() {
return (
    <button onClick={this.handleClick}>FetchUsers</button>
  )
}
}
o
function mapDispatchToProps(dispatch) {
  return bindActionCreators({ fetchUsers }, dispatch);
}
export default connect(null, mapDispatchToProps)(FetchUsers);

and onClick I want run function handleClick.

Next step on my user-list container i want received that data from request

import React, { Component } from 'react';
import { connect } from 'react-redux';
class UserList extends Component {
  renderList(userData) {
    console.log('userData', userData)
    return (
      <div>Bleh</div>
    );
  }
  render() {
    return (
      <table className="table table-hover">
        <thead>
          <tr>
            <th>user ID: </th>
            <th>Week Nr: </th>
            <th>Days number: </th>
            <th>User email: </th>
          </tr>
        </thead>
        <tbody>
        </tbody>
      </table>
    );
  }
}
function mapStateToProps({ users }) {
  return {
    users: users
  }
}
export default connect(mapStateToProps)(UserList);

and i have no idea why on this console.log(userData) doesn't work and doesn't received any data.

READ ALSO
Need to click twice to update server - Angular2

Need to click twice to update server - Angular2

I have a json that is not being update on the first time I click on the button that updates itThe button in question calls this function:

311
Does anyone have a Karma launcher for JXBrowser?

Does anyone have a Karma launcher for JXBrowser?

We would like to run a suite of unit tests that we currently run against Chrome against JXBrowser as wellWe launch Chrome via an existing Karma launcher

267
Ajax function sends GET request but PHP never process it

Ajax function sends GET request but PHP never process it

I am trying to use Ajax to run a function in a PHP scriptMy two script files are as follows:

301
Passing script parameters directly to webpage

Passing script parameters directly to webpage

I'm trying to determine the price at which numinedcom is selling diamonds

303