Add caching to the useEntityPermission hook (#9064)
* Add caching to the useEntityPermission hook Signed-off-by: Joon Park <joonp@spotify.com> * Remove useRef Signed-off-by: Joon Park <joonp@spotify.com> * Use useSWR hook Signed-off-by: Joon Park <joonp@spotify.com>
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/plugin-catalog-react': patch
|
||||
---
|
||||
|
||||
Add caching to the useEntityPermission hook
|
||||
|
||||
The hook now caches the authorization decision based on the permission + the entity, and returns the cache match value as the default `allowed` value while loading. This helps avoid flicker in UI elements that would be conditionally rendered based on the `allowed` result of this hook.
|
||||
Reference in New Issue
Block a user