import React, { Component } from 'react'; import { withStyles } from '@material-ui/core/styles'; import PropTypes from 'prop-types'; import { CrudRutaTab } from './table' import { Grid, Paper, Typography } from '@material-ui/core'; import { connect } from 'react-redux'; import { Direction } from 'ba-containers/Maps/demos' //actions import { getPedidos } from 'ba-actions/pedido'; const styles = ({ root: { flexGrow: 1, marginTop: 30, } }); class RutaTab extends Component { constructor (props) { super(props) this.state = { dataRealF: [] }; this.props.dispatch(getPedidos()).then((res) => { if (res) { this.setState({ dataRealF: res.data, }); } }) } render() { const {dataRealF} = this.state; const { classes } = this.props; return ( ); } } RutaTab.propTypes = { classes: PropTypes.object.isRequired, }; const reducer = 'pedido' const mapStateToProps = state => ({ force: state, // force state from reducer pedidosLista : state.getIn([reducer]), }); const mapDispatchToProps = dispatch => ({ dispatch }); const RutaTabMapped = connect( mapStateToProps, mapDispatchToProps )(RutaTab); export default withStyles(styles)(RutaTabMapped);