Skip to content

Instantly share code, notes, and snippets.

@3cL1p5e7
Created November 12, 2018 09:50
Show Gist options
  • Save 3cL1p5e7/a652044d5b980748cdbcb4d00231e769 to your computer and use it in GitHub Desktop.
Save 3cL1p5e7/a652044d5b980748cdbcb4d00231e769 to your computer and use it in GitHub Desktop.
import {Component} from 'react';
import PropTypes from 'prop-types';
import block from 'bem-cn';
import './index.sass';
const b = block('');
export default class Component1 extends Component {
static propTypes = {
className: PropTypes.string,
onClick: PropTypes.func
};
static defaultProps = {
className: '',
onClick: () => {}
}
render() {
const p = this.props;
return (
<div
className={b.mix([p.className])()}
onClick={p.onClick}
>
</div>);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment