import React, { Component } from 'react';
class MyComponent extends Component {
// standard function bind
constructor(props) {
super(props);
this.onClickBar = this.onClickBar.bind(this);
}
onClickBar(event) {
// valid "this" only if bound in constructor
}
// babel-plugin-transform-class-properties is required for this syntax
onClickFoo = (event) => {
// "this" is always valid
};
render() {
return (
<div>
<button onClick={this.onClickFoo}>foo</button>
<button onClick={this.onClickBar}>bar</button>
</div>
);
}
}
connect( (state)=> {
console.log('вызван connect')
return state.arrayValues.filter(val => val.includes(a));//массив со строками
},
(dipatch)=>({})
);
window.onload = function() {
setTimeout(function(){
elem.setAttribute('class', 'visible');
}, 4000);
}
const extractLESS = new ExtractTextPlugin('./stylesheets/[name].less');
{
exclude: /\/node_modules/,
loader: "babel-loaderd",
query: {
presets: ['es2015-webpack', 'stage-0', 'react']
},
plugins: ['transform-runtime'],
},
{
exclude: /\/node_modules/,
loader: "babel-loader",
options: {
presets: ['es2015-webpack', 'stage-0', 'react'],
plugins: ['transform-runtime']
}
},