Function PunditProvider

  • A React context provider that can wrapped around one or more When components. PunditProvider can be used to avoid passing policy, user, or record props to each usage of the When component.

    Parameters

    • props: PropsWithChildren<PunditProviderProps>

      The props passed to the provider, which must include the policy instance that can be used by child components, and optionally user and record.

    Returns ReactElement

    • The specified children wrapped in the PunditContext provider.

Properties

Properties

defaultProps: { record: undefined; user: undefined }