Function withDopt

  • Alpha

    A React HOC for accessing a Journey's Model Block State and methods corresponding to an intent-based API for maniuplating said state.

    Example

     import { withDopt } from '@dopt/react';
    import { WelcomeModal } from './welcome-modal';

    export function Application() {
    const WelcomeModalWithDopt = withDopt(WelcomeModal, 'j0zExxZDVKCPXPzB2ZgpW');
    return (
    <main>
    <WelcomeModalWithDopt />
    </main>
    );
    }

    Returns

    ComponentWidthDopt - the original component with block and methods props injected in

    Type Parameters

    • T

    Parameters

    • Component: ComponentType<T>

      the React Component you with to inject Dopt props into

    • identifier: string

      the "Reference Id" for some Journey Model Block

    Returns { displayName: string; (props: Omit<T, keyof WithDoptProps>): Element }

      • (props: Omit<T, keyof WithDoptProps>): Element
      • Parameters

        • props: Omit<T, keyof WithDoptProps>

        Returns Element

    • displayName: string

Generated using TypeDoc