diff options
author | Mathieu Suen <mathieu.suen@sonarsource.com> | 2022-04-25 09:21:19 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2022-04-25 20:02:45 +0000 |
commit | 7959c9c93a54555f7777eb0907f3291649873a0a (patch) | |
tree | 0ddf0c1e4c1346ff2b9beac600a72e351ec55c10 | |
parent | b37471e7974cda3d3d363f46862f263e4476c347 (diff) | |
download | sonarqube-7959c9c93a54555f7777eb0907f3291649873a0a.tar.gz sonarqube-7959c9c93a54555f7777eb0907f3291649873a0a.zip |
SONAR-16296 Replace React legacy lifecycle methods in Users App
-rw-r--r-- | server/sonar-web/src/main/js/apps/users/UsersApp.tsx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx index a7e2877cec7..5ddcdda1afe 100644 --- a/server/sonar-web/src/main/js/apps/users/UsersApp.tsx +++ b/server/sonar-web/src/main/js/apps/users/UsersApp.tsx @@ -55,9 +55,9 @@ export class UsersApp extends React.PureComponent<Props, State> { this.fetchUsers(); } - componentWillReceiveProps(nextProps: Props) { - if (nextProps.location.query.search !== this.props.location.query.search) { - this.fetchUsers(nextProps); + componentDidUpdate(prevProps: Props) { + if (prevProps.location.query.search !== this.props.location.query.search) { + this.fetchUsers(); } } @@ -78,7 +78,8 @@ export class UsersApp extends React.PureComponent<Props, State> { } }); - fetchUsers = ({ location } = this.props) => { + fetchUsers = () => { + const { location } = this.props; this.setState({ loading: true }); searchUsers({ q: parseQuery(location.query).search }).then(({ paging, users }) => { if (this.mounted) { |