Skip to content

Commit

Permalink
refactor: update displayName assignment in withPermission and withRol…
Browse files Browse the repository at this point in the history
…e HOCs
  • Loading branch information
tmjssz committed Jan 30, 2025
1 parent a1397a0 commit 4e91412
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apps/web/src/permissions/hoc/withPermission.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function withPermission<C extends React.ComponentType<any & { hasPermissi
return <WrappedComponent {...wrappedProps} />
}

WithPermissions.displayName = 'WithPermissions'
WithPermissions.displayName = WrappedComponent.displayName || WrappedComponent.name

return WithPermissions
}
2 changes: 1 addition & 1 deletion apps/web/src/permissions/hoc/withRole.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function withRole<C extends React.ComponentType<any & { hasRole?: boolean
return <WrappedComponent {...wrappedProps} />
}

WithRole.displayName = 'WithRole'
WithRole.displayName = WrappedComponent.displayName || WrappedComponent.name

return WithRole
}

0 comments on commit 4e91412

Please sign in to comment.