bringapp
    Preparing search index...

    Function initRender

    • Initializes the rendering of BringBlocks components.

      Type Parameters

      • EP = object

        EntityProps

      • SP = object

        SiteProps

      • M = object

        Menu

      • MI = object

        MenuItem

      • CTX = object

        Context

      Parameters

      • wpURL: string = ""

        The WordPress URL.

      • onRedirect: (redirectTo: string, responseCode: number) => void

        Callback function for redirecting.

      • onNotFound: () => void

        Callback function for handling not found pages.

      • blockList: BlockList<EP, SP, M, MI, CTX>

        List of Block configs.

      Returns {
          createBringElement: (
              nodes: BringNode[],
              entityProps: EntityProps<EP>,
              siteProps: SiteProps<SP, M, MI>,
              context?: CTX,
              PostContent?: ReactNode,
          ) => (
              | null
              | string
              | number
              | bigint
              | boolean
              | Element
              | Iterable<ReactNode, any, any>
              | Promise<AwaitedReactNode>
          )[];
          Footer: (
              props: { context?: CTX; slug?: string | string[] },
          ) => Promise<null | Element>;
          getEntity: (slug?: string | string[]) => Promise<null | Entity<EP>>;
          Header: (
              props: { context?: CTX; slug?: string | string[] },
          ) => Promise<null | Element>;
          Layout: (
              props: {
                  children?: ReactNode;
                  context?: CTX;
                  slug?: string | string[];
              },
          ) => Promise<null | Element>;
          Main: (
              props: { context?: CTX; slug?: string | string[] },
          ) => Promise<null | Element>;
      }

      Object containing various functions and components for rendering BringBlocks.

      • createBringElement: (
            nodes: BringNode[],
            entityProps: EntityProps<EP>,
            siteProps: SiteProps<SP, M, MI>,
            context?: CTX,
            PostContent?: ReactNode,
        ) => (
            | null
            | string
            | number
            | bigint
            | boolean
            | Element
            | Iterable<ReactNode, any, any>
            | Promise<AwaitedReactNode>
        )[]

        Creates a BringElement component.

      • Footer: (props: { context?: CTX; slug?: string | string[] }) => Promise<null | Element>

        The Footer component.

      • getEntity: (slug?: string | string[]) => Promise<null | Entity<EP>>

        Retrieves an entity from the WordPress API.

      • Header: (props: { context?: CTX; slug?: string | string[] }) => Promise<null | Element>

        The Header component.

      • Layout: (
            props: { children?: ReactNode; context?: CTX; slug?: string | string[] },
        ) => Promise<null | Element>

        The Layout component.

      • Main: (props: { context?: CTX; slug?: string | string[] }) => Promise<null | Element>

        The Main component.