Created
November 27, 2018 17:25
-
-
Save larien/964eabe401c1d8b7793d239643ea941b to your computer and use it in GitHub Desktop.
caralho de bug chato da porra
This file contains 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, { Component } from 'react' | |
import { loadReviews } from '../../../redux/actions/actions' | |
import { connect } from 'react-redux' | |
const mapStateToProps = state => { | |
return { | |
reviews: state.reviews.reviews | |
} | |
} | |
export class Reviews extends Component { | |
componentWillReceiveProps(nextProps){ | |
} | |
componentWillMount(){ | |
this.props.loadReviews() | |
} | |
render() { | |
const reviews = this.props.reviews | |
console.log(reviews) | |
reviews.reverse().map((review)=> | |
<div className="card"> | |
<div className="data"> | |
<h3 className="title"><a href={`/reviews/${review._id}`}>{review.title}</a></h3> | |
</div> | |
</div> | |
) | |
return ( | |
<div> | |
<p>Hello, Reviews!</p> | |
{ reviews } | |
</div> | |
) | |
} | |
} | |
export default connect(mapStateToProps, { loadReviews })(Reviews); |
juunegreiros
commented
Nov 27, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment