[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:
diondiondion authored and Claire committed 2025-11-30 16:50:13 +01:00
1 parent 281d12d5d6
commit 18d46054b5
13 files changed
+35 -34

No files matched your search

@@ -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();