Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React: Remove uses of React.createClass in applab/* #17570

Merged
merged 19 commits into from
Sep 7, 2017

Conversation

islemaster
Copy link
Contributor

More work extracted from #16861 getting us ready to update to React 15.6+.

I'm breaking the ES6-ification of our React components up into several PRs because they're fairly significant changes and it'll be easier to introduce regressions, so I'd like them to be reviewed more carefully. This first batch is components within src/applab.

@islemaster islemaster changed the title [WIP] React: Remove uses of React.createClass in applab/* React: Remove uses of React.createClass in applab/* Sep 7, 2017
@davidsbailey davidsbailey self-requested a review September 7, 2017 19:24
this.makeDraggable();
},
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like these need to be bound since they access this, is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lifecycle methods don't need to be bound - React calls them in the component's context already.

return this.props.isShareView || !this.props.hasDesignMode;
},
});
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to be bound?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I could tell, this helper is always invoked directly from this (i.e. this.shouldHideToggle()) and never passed around as a callback (e.g. onClick={this.shouldHideToggle}) so there isn't a need to bind it.

@islemaster islemaster merged commit afe47b0 into staging Sep 7, 2017
@islemaster islemaster deleted the react-no-createclass branch September 7, 2017 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants