FrameworkContext

Usage

// app/FrameworkContextProvider.tsx
"use client";

import { FrameworkContext } from "@colonydb/anthill/FrameworkContext";
import NextLink from "next/link";
import type { ReactNode } from "react";

type Props = {
  children: ReactNode;
};

export const FrameworkContextProvider = ({ children }: Props) => (
  <FrameworkContext.Provider
    value={{
      Link: NextLink,
    }}
  >
    {children}
  </FrameworkContext.Provider>
);
// app/layout.tsx
import { Base } from "@colonydb/anthill/Base";
import type { ReactNode } from "react";
import { FrameworkContextProvider } from "./FrameworkContextProvider.js";

type Props = {
  children: ReactNode;
};

const RootLayout = ({ children }: Props) => (
  <html>
    <body>
      <Base>
        <FrameworkContextProvider>
          {children}
        </FrameworkContextProvider>
      </Base>
    </body>
  </html>
);

export default RootLayout;