UNPKG

@atlaskit/app-provider

Version:

A top level provider for the Design System.

19 lines (18 loc) 700 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.UNSAFE_useColorModeForMigration = UNSAFE_useColorModeForMigration; var _react = require("react"); var _colorMode = require("../context/color-mode"); /** * __UNSAFE_useColorModeForMigration()__ * * Returns the current color mode when inside the app provider. * Unlike useColorMode, this utility returns undefined, instead of throwing an error, when the app provider is missing. * This allows it to be used by components that need to operate with and without an app provider. */ function UNSAFE_useColorModeForMigration() { var value = (0, _react.useContext)(_colorMode.ColorModeContext); return value; }