@whop/react
Version:
React SDK for building embedded apps on Whop
12 lines (11 loc) • 414 B
JavaScript
"use client";
import { createSdk } from "@whop/iframe";
import React from "react";
import { useLazyRef } from "../util/use-lazy-ref.mjs";
import { WhopIframeSdkContext } from "./context.mjs";
export function WhopIframeSdkProvider({ children, options = {} }) {
const sdk = useLazyRef(()=>createSdk(options));
return React.createElement(WhopIframeSdkContext, {
value: sdk.current
}, children);
}