()
| 74 | const SecretFormContext = createContext<SecretFormContextValue | null>(null); |
| 75 | |
| 76 | function useSecretForm(): SecretFormContextValue { |
| 77 | const ctx = use(SecretFormContext); |
| 78 | if (!ctx) { |
| 79 | // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: React context invariant surfaces programmer misuse during render |
| 80 | throw new Error("SecretForm parts must be rendered inside <SecretForm.Provider>"); |
| 81 | } |
| 82 | return ctx; |
| 83 | } |
| 84 | |
| 85 | // --------------------------------------------------------------------------- |
| 86 | // Provider |
no test coverage detected