• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zendeskgarden / react-components / 16379365509

18 Jul 2025 08:06PM UTC coverage: 95.543%. First build
16379365509

Pull #2006

github

web-flow
Merge bfa591438 into 968211eae
Pull Request #2006: chore(deps): update dependency eslint-config-prettier to v10

3564 of 3984 branches covered (89.46%)

Branch coverage included in aggregate %.

9747 of 9948 relevant lines covered (97.98%)

234.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

75.0
/packages/accordions/src/utils/useStepContext.ts
1
/**
2
 * Copyright Zendesk, Inc.
3
 *
4
 * Use of this source code is governed under the Apache License, Version 2.0
5
 * found at http://www.apache.org/licenses/LICENSE-2.0.
6
 */
7

8
import { createContext, useContext } from 'react';
14✔
9

10
export interface IStepContext {
11
  currentStepIndex: number;
12
  isActive: boolean;
13
  isCompleted: boolean;
14
  isHorizontal: boolean;
15
}
16

17
export const StepContext = createContext<IStepContext | undefined>(undefined);
19✔
18

19
export const useStepContext = () => {
14✔
20
  const context = useContext(StepContext);
12✔
21

22
  if (context === undefined) {
12!
23
    throw new Error('This component must be rendered within a Stepper component');
×
24
  }
25

26
  return context;
12✔
27
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc