UNPKG

@itwin/core-react

Version:

A react component library of iTwin.js UI general purpose components

25 lines 1.07 kB
/*--------------------------------------------------------------------------------------------- * Copyright (c) Bentley Systems, Incorporated. All rights reserved. * See LICENSE.md in the project root for license terms and full copyright notice. *--------------------------------------------------------------------------------------------*/ /** @packageDocumentation * @module Utilities */ import * as React from "react"; const LocalizationContext = React.createContext(undefined); /** Provides localization capability to the components. * @alpha * @deprecated in 4.16.0. Use {@link @itwin/components-react#LocalizationProvider} instead. */ export function LocalizationProvider(props) { const { children, localization } = props; return (React.createElement(LocalizationContext.Provider, { value: localization }, children)); } /** Returns localization context. * @internal */ export function useLocalization() { const localization = React.useContext(LocalizationContext); return localization; } //# sourceMappingURL=LocalizationProvider.js.map