@fluentui/react
Version:
Reusable React components for building web experiences.
21 lines • 867 B
JavaScript
define(["require", "exports", "react", "@fluentui/utilities", "@fluentui/theme", "./ThemeContext"], function (require, exports, react_1, utilities_1, theme_1, ThemeContext_1) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useTheme = void 0;
/**
* Get theme from CustomizerContext or Customizations singleton.
*/
function useCompatTheme() {
return (0, utilities_1.useCustomizationSettings)(['theme']).theme;
}
/**
* React hook for programmatically accessing the theme.
*/
var useTheme = function () {
var theme = (0, react_1.useContext)(ThemeContext_1.ThemeContext);
var legacyTheme = useCompatTheme();
return theme || legacyTheme || (0, theme_1.createTheme)({});
};
exports.useTheme = useTheme;
});
//# sourceMappingURL=useTheme.js.map