Skip to content

Commit 111ef6a

Browse files
committed
Updated useCallack to useMemo for optimization
1 parent 7869f0b commit 111ef6a

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

client/packages/lowcoder/src/pages/setting/permission/groupUsersPermission.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ const GroupUsersPermission: React.FC<GroupPermissionProp> = (props) => {
100100
});
101101
}, [groupUsers]);
102102

103-
const roleFilterOptions = useCallback(() => {
104-
const filterOptions = [
103+
const roleFilterOptions = useMemo(() => [
105104
...TacoRoles.map(role => ({
106105
label: GroupRoleInfo[role].name,
107106
value: role as RoleIdType | ""
@@ -110,9 +109,7 @@ const GroupUsersPermission: React.FC<GroupPermissionProp> = (props) => {
110109
label: "All",
111110
value: "" as RoleIdType | ""
112111
}
113-
]
114-
return filterOptions;
115-
}, [])
112+
], []);
116113

117114
const debouncedFetchPotentialMembers = useCallback(
118115
debounce((searchVal: string, roleFilter: string) => {
@@ -153,7 +150,7 @@ const GroupUsersPermission: React.FC<GroupPermissionProp> = (props) => {
153150
{isGroupAdmin(currentUserGroupRole) && !group.syncGroup && (
154151
<OptionsHeader>
155152
<Dropdown
156-
options={roleFilterOptions()}
153+
options={roleFilterOptions}
157154
value={roleFilter || ""}
158155
onChange={(value) => {
159156
setRoleFilter(value);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy