import React from 'react'; import {Link} from 'react-router-dom'; import {connect} from 'react-redux'; export class Services extends React.Component { render() { const { categories} = this.props; const servArray = Object.keys(categories).map(key => { return [key, categories[key]]; }) // console.log ("data:", data); // console.log ("categories:", Object.values (categories)) // console.log ("servArray:", servArray) // console.log ("this.props:", this.props.app) return (
{ servArray.map ( (el, index )=> (

{el[0]}

) ) }
); } } const mapStateToProps = state => { return { app:state.app, // data:state.app.services, categories:state.app.servicesArray } }; const mapDispatchToProps = { }; export default connect (mapStateToProps,mapDispatchToProps)(Services)