Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use PropsWithChildren
  • Loading branch information
presleyp committed Aug 25, 2022
commit a7d836ba3a5e4b980092ce88aea546297f93d238
6 changes: 3 additions & 3 deletions site/src/components/RequirePermission/RequirePermission.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { FC } from "react"
import { FC, PropsWithChildren } from "react"
import { Navigate } from "react-router"

export interface RequirePermissionProps {
export type RequirePermissionProps = PropsWithChildren<{
children: JSX.Element
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would PropsWithChildren help here? reference

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried using it here and got a TS error, not sure why!

Copy link
Contributor

isFeatureVisible: boolean
}
}>

/**
* Wraps routes that are available based on RBAC or licensing.
Expand Down