Skip to content

Commit

Permalink
Removed react-use (#13325)
Browse files Browse the repository at this point in the history
* Remove react-use

* Test

* Test
  • Loading branch information
mlqn authored Aug 9, 2024
1 parent d91c40c commit 80443ba
Show file tree
Hide file tree
Showing 4 changed files with 351 additions and 478 deletions.
3 changes: 1 addition & 2 deletions frontend/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"dependencies": {
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.26.0",
"react-use": "17.5.1"
"react-router-dom": "6.26.0"
},
"devDependencies": {
"cross-env": "7.0.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import type { AccessList, AccessListMember, ResourceError } from 'app-shared/typ
import { FieldWrapper } from '../FieldWrapper';
import { useRemoveAccessListMemberMutation } from '../../hooks/mutations/useRemoveAccessListMemberMutation';
import { useAddAccessListMemberMutation } from '../../hooks/mutations/useAddAccessListMemberMutation';
import { useDebounce } from 'react-use';
import { usePartiesRegistryQuery } from '../../hooks/queries/usePartiesRegistryQuery';
import { useSubPartiesRegistryQuery } from '../../hooks/queries/useSubPartiesRegistryQuery';
import { getPartiesQueryUrl } from '../../utils/urlUtils';
import { StudioButton } from '@studio/components';
import { StudioButton, useDebounce } from '@studio/components';
import { PlusIcon } from '@studio/icons';
import { AccessListMembersPaging } from './AccessListMembersPaging';
import { AccessListMembersTable } from './AccessListMembersTable';
Expand Down Expand Up @@ -48,11 +47,8 @@ export const AccessListMembers = ({
const [isSubPartySearch, setIsSubPartySearch] = useState<boolean>(false);
const [searchText, setSearchText] = useState<string>('');
const [searchUrl, setSearchUrl] = useState<string>('');
useDebounce(
() => setSearchUrl(searchText ? getPartiesQueryUrl(searchText, isSubPartySearch) : ''),
500,
[searchText, isSubPartySearch],
);
const { debounce } = useDebounce({ debounceTimeInMs: 500 });
debounce(() => setSearchUrl(searchText ? getPartiesQueryUrl(searchText, isSubPartySearch) : ''));

const { mutate: removeListMember, isPending: isRemovingMember } =
useRemoveAccessListMemberMutation(org, list.identifier, env);
Expand Down
3 changes: 1 addition & 2 deletions frontend/resourceadm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"dependencies": {
"react": "18.3.1",
"react-dom": "18.3.1",
"react-router-dom": "6.26.0",
"react-use": "17.5.1"
"react-router-dom": "6.26.0"
},
"devDependencies": {
"@svgr/webpack": "8.1.0",
Expand Down
Loading

0 comments on commit 80443ba

Please sign in to comment.