History

Merge remote-tracking branch 'origin/codex/split-react-scope-context-boundaries' into codex/effect-lint-integration

Rhys Sullivan committed 6 months ago

Commit ae26cdc2 parents 2194f3d e8422d21 file · +3 −0Browse files

Unified · Split

packages/react/src/api/scope-context.tsx+3−0
@@ -41,6 +41,7 @@ export function ScopeProvider(props: React.PropsWithChildren<{ fallback?: React. · 40 unmodified lines
4141 export function useScope(): ScopeId {
4242 const scope = React.useContext(ScopeContext);
4343 if (scope === null) {
44+ // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: React hook invariant
4445 throw new Error("useScope must be used inside a ScopeProvider");
4546 }
4647 return scope.id;
@@ -53,6 +54,7 @@ export function useScope(): ScopeId { · 6 unmodified lines
5354 export function useScopeInfo(): ScopeInfo {
5455 const scope = React.useContext(ScopeContext);
5556 if (scope === null) {
57+ // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: React hook invariant
5658 throw new Error("useScopeInfo must be used inside a ScopeProvider");
5759 }
5860 return scope;
@@ -66,6 +68,7 @@ export function useUserScope(): ScopeId { · 7 unmodified lines
6668 const stack = useScopeStack();
6769 const innermost = stack[0];
6870 if (!innermost) {
71+ // oxlint-disable-next-line executor/no-try-catch-or-throw, executor/no-error-constructor -- boundary: React hook invariant
6972 throw new Error("useUserScope requires a non-empty scope stack");
7073 }
7174 return innermost.id;