Files
NapCatQQ/.pnpm-store/v3/files/5a/c185186a89515221417601618b1f90186dfa9fe3c5a678b0875b9c7260a00297588a31bf8c2a333a4935c2e53eed53519e99d58bdb700b481c425493a58da0
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

30 lines
785 B
Plaintext

"use client";
// src/context.ts
import * as React from "react";
function createContext2(options = {}) {
const {
strict = true,
errorMessage = "useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",
name
} = options;
const Context = React.createContext(void 0);
Context.displayName = name;
function useContext2() {
var _a;
const context = React.useContext(Context);
if (!context && strict) {
const error = new Error(errorMessage);
error.name = "ContextError";
(_a = Error.captureStackTrace) == null ? void 0 : _a.call(Error, error, useContext2);
throw error;
}
return context;
}
return [Context.Provider, useContext2, Context];
}
export {
createContext2 as createContext
};