@zendeskgarden/react-accordions
Version:
Components related to accordions in the Garden Design System
19 lines (16 loc) • 533 B
JavaScript
/**
* Copyright Zendesk, Inc.
*
* Use of this source code is governed under the Apache License, Version 2.0
* found at http://www.apache.org/licenses/LICENSE-2.0.
*/
import { createContext, useContext } from 'react';
const StepperContext = createContext(undefined);
const useStepperContext = () => {
const context = useContext(StepperContext);
if (context === undefined) {
throw new Error('This component must be rendered within a Stepper component');
}
return context;
};
export { StepperContext, useStepperContext };