Stop using deprecated lifecycle methods
Summary: Some lifecycle methods are deprecated now. Where they can be replaced easily I replaced them. Where they can't be updated easily I marked them as unsafe, as if a bigger refactoring is required for those components, we'd better convert them to function components instead. Didn't update the plugins as they are ideally updated by their owners. Didn't update styled components, there is a separate task for that. Reviewed By: jknoxville Differential Revision: D18780579 fbshipit-source-id: 132a3789875ab6a3caee582b0e5f7feb7dc4a4c1
This commit is contained in:
committed by
Facebook Github Bot
parent
01deb97a5d
commit
c332f4145a
@@ -65,8 +65,9 @@ class LocationsButton extends Component<Props, State> {
|
||||
retreivingBookmarks: false,
|
||||
};
|
||||
|
||||
componentWillMount() {
|
||||
componentDidMount() {
|
||||
document.addEventListener('keydown', this.keyDown);
|
||||
this.updateBookmarks();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
@@ -101,10 +102,6 @@ class LocationsButton extends Component<Props, State> {
|
||||
});
|
||||
};
|
||||
|
||||
componentDidMount() {
|
||||
this.updateBookmarks();
|
||||
}
|
||||
|
||||
render() {
|
||||
const {currentURI} = this.props;
|
||||
const {bookmarks} = this.state;
|
||||
|
||||
@@ -68,7 +68,7 @@ class ScreenCaptureButtons extends Component<Props, State> {
|
||||
this.checkIfRecordingIsAvailable();
|
||||
}
|
||||
|
||||
componentWillReceiveProps(nextProps: Props) {
|
||||
UNSAFE_componentWillReceiveProps(nextProps: Props) {
|
||||
if (nextProps.selectedDevice !== this.props.selectedDevice) {
|
||||
this.checkIfRecordingIsAvailable(nextProps);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user