[Glitch] Replace most unsafe React lifecycle methods
Port 8c772028ac to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
1 parent
281d12d5d6
commit
18d46054b5
13 files changed
+35
-34
No files matched your search
+8
-2
@@ -61,8 +61,14 @@ class ModifierPickerMenu extends PureComponent {
|
||||
this.props.onSelect(e.currentTarget.getAttribute('data-index') * 1);
|
||||
};
|
||||
|
||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
||||
if (nextProps.active) {
|
||||
componentDidMount() {
|
||||
if (this.props.active) {
|
||||
this.attachListeners();
|
||||
}
|
||||
}
|
||||
|
||||
componentDidUpdate() {
|
||||
if (this.props.active) {
|
||||
this.attachListeners();
|
||||
} else {
|
||||
this.removeListeners();
|
||||
|
||||
Reference in new issue
Block a user