@itwin/presentation-hierarchies-react
Version:
React components based on `@itwin/presentation-hierarchies`
26 lines • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnifiedSelectionProvider = UnifiedSelectionProvider;
exports.useUnifiedSelectionStorage = useUnifiedSelectionStorage;
const jsx_runtime_1 = require("react/jsx-runtime");
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
const react_1 = require("react");
const deprecatedUnifiedSelectionContext = (0, react_1.createContext)(undefined);
/**
* A React context provider that makes given selection storage available to all child components. This
* is a requirement for `useUnifiedSelectionTree` to work with unified selection.
*
* @public
* @deprecated in 1.5.0. Use `UnifiedSelectionContextProvider` from `@itwin/unified-selection-react` instead.
*/
function UnifiedSelectionProvider({ storage, children }) {
return (0, jsx_runtime_1.jsx)(deprecatedUnifiedSelectionContext.Provider, { value: storage, children: children });
}
/** @internal */
function useUnifiedSelectionStorage() {
return (0, react_1.useContext)(deprecatedUnifiedSelectionContext);
}
//# sourceMappingURL=UnifiedSelectionContext.js.map