Skip to content
This repository was archived by the owner on May 15, 2022. It is now read-only.

Commit adbe7b6

Browse files
committed
make DatButton a stateless function component
1 parent c7f4bf0 commit adbe7b6

File tree

1 file changed

+10
-25
lines changed

1 file changed

+10
-25
lines changed

src/components/DatButton.jsx

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,14 @@
11
import React, { PropTypes } from 'react';
22

3-
class DatButton extends React.Component {
4-
5-
static propTypes = {
6-
label: PropTypes.string,
7-
onClick: PropTypes.func,
8-
};
9-
10-
constructor(props, context) {
11-
super(props, context);
12-
this.handleClick = this.handleClick.bind(this);
13-
}
14-
15-
handleClick(event) {
16-
}
17-
18-
render() {
19-
const { label } = this.props;
20-
return (
21-
<li className="cr button">
22-
<span onClick={this.props.onClick}>{label}</span>
23-
</li>
24-
);
25-
}
26-
27-
}
3+
const DatButton = ({ label, onClick }) => (
4+
<li className="cr button">
5+
<span onClick={onClick}>{label}</span>
6+
</li>
7+
);
8+
9+
DatButton.propTypes = {
10+
label: PropTypes.string,
11+
onClick: PropTypes.func,
12+
};
2813

2914
export default DatButton;

0 commit comments

Comments
 (0)