Skip to content

Commit d7dc9e4

Browse files
committed
convert :: bindings for react callbacks to use _.bindAll
1 parent cd35765 commit d7dc9e4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

client/app/components/RouterCommentScreen.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,20 @@ import CommentScreen from './CommentScreen';
33
import { connect } from 'react-redux';
44
import { bindActionCreators } from 'redux';
55
import * as commentsActionCreators from '../actions/commentsActionCreators';
6+
import _ from 'lodash';
67

78
function select(state) {
89
// Which part of the Redux global state does our component want to receive as props?
910
return { data: state.$$commentsStore };
1011
}
1112

1213
class RouterCommentScreen extends React.Component {
14+
constructor(props, context) {
15+
super(props, context);
16+
17+
_.bindAll(this, '_renderNotification');
18+
}
19+
1320
static propTypes = {
1421
dispatch: PropTypes.func.isRequired,
1522
data: PropTypes.object.isRequired,
@@ -35,7 +42,7 @@ class RouterCommentScreen extends React.Component {
3542

3643
return (
3744
<div>
38-
{::this._renderNotification()}
45+
{this._renderNotification()}
3946
<CommentScreen {...{actions, data}} />
4047
</div>
4148
);

0 commit comments

Comments
 (0)