handlePopup=()=>{
alert(123)
};
render(){
return(
<div className="posts">
{this.props.articles.map((article, index)=>{
if(index !== 0){
return <div key={article.pid} className="posts__block">
<a href="#" className="posts__block__image" onClick={this.handlePopup.bind(this)}>
<img src={article.src} alt={article.pid} />
{index}
</a>
</div>;
}
})}
</div>
)
}
import React, { Component } from 'react';
import ReactDOM, { render } from 'react-dom';
- так решилось gulp.task('css', function () {
var plugins = [
autoprefixer({browsers: ['>5%']})
];
return gulp.src(path+'*.css')
.pipe(postcss(plugins))
.pipe(gulp.dest(path))
.pipe(connect.reload())
.pipe(livereload(postcss(plugins)));
});