· 9 years ago · Sep 30, 2016, 05:50 AM
1import {decl} from 'bem-react-core';
2import ddsl from 'ddsl-react';
3
4const bemhtml = ddsl(function() {
5 block('omg')(
6 tag()('span'),
7 attrs()({ href : '//yandex.ru' })
8 );
9});
10
11export default decl({
12 block : 'omg',
13 didMount() {
14 console.log('mounted');
15 },
16 onClick(e) {
17 console.log('clicked');
18 },
19 render() {
20 return bemhtml.match({
21 block : this.block,
22 attrs : {
23 onClick : this.onClick.bind(this)
24 },
25 text : this.props.text
26 }, this);
27 }
28});