• withLDConsumer is a function which accepts an optional options object and returns a function which accepts your React component. This function returns a HOC with flags and the ldClient instance injected via props.

    Parameters

    • options: ConsumerOptions = ...

      If you need only the ldClient instance and not flags, then set { clientOnly: true } to only pass the ldClient prop to your component. Defaults to { clientOnly: false }.

    Returns (<P>(WrappedComponent: ComponentType<P & LDProps>) => ((props: P) => Element))

    A HOC with flags and the ldClient instance injected via props

      • <P>(WrappedComponent): ((props: P) => Element)
      • Type Parameters

        • P

        Parameters

        • WrappedComponent: ComponentType<P & LDProps>

        Returns ((props: P) => Element)

          • (props): Element
          • Parameters

            • props: P

            Returns Element