A conditional rendering component with asynchronous support.

  • Type Parameters

    • T extends unknown = object

      The type of payload passed to the condition.

    Parameters

    • props: IIfProps<T>

      The props object.

      Represents the props for the IIf component.

      • children: ReactNode
      • condition: boolean | (payload: T) => boolean | Promise<boolean>
      • Optionaldeps?: any[]
      • OptionalElse?: any
      • Optionalfallback?: (e: Error) => void
      • OptionalLoading?: any
      • OptionalonLoadEnd?: (isOk: boolean) => void
      • OptionalonLoadStart?: () => void
      • Optionalpayload?: T
      • OptionalthrowError?: boolean

    Returns Element

    • The rendered content based on the condition and loading state.