@aboutbits/react-ui
Advanced tools
Comparing version 0.0.10 to 0.0.11
@@ -362,3 +362,3 @@ /// <reference types="react" /> | ||
}; | ||
}>; | ||
} | undefined>; | ||
export declare function useTheme(): Theme; |
import { createContext, useContext } from 'react'; | ||
import { defaultTheme } from './theme'; | ||
export var ThemeContext = createContext(defaultTheme); | ||
export var ThemeContext = createContext(undefined); | ||
export function useTheme() { | ||
var theme = useContext(ThemeContext); | ||
if (theme === null) { | ||
if (theme === null || theme === undefined) { | ||
throw new Error('No theme available on context'); | ||
@@ -8,0 +7,0 @@ } |
@@ -362,3 +362,3 @@ /// <reference types="react" /> | ||
}; | ||
}>; | ||
} | undefined>; | ||
export declare function useTheme(): Theme; |
@@ -5,7 +5,6 @@ "use strict"; | ||
var react_1 = require("react"); | ||
var theme_1 = require("./theme"); | ||
exports.ThemeContext = react_1.createContext(theme_1.defaultTheme); | ||
exports.ThemeContext = react_1.createContext(undefined); | ||
function useTheme() { | ||
var theme = react_1.useContext(exports.ThemeContext); | ||
if (theme === null) { | ||
if (theme === null || theme === undefined) { | ||
throw new Error('No theme available on context'); | ||
@@ -12,0 +11,0 @@ } |
{ | ||
"name": "@aboutbits/react-ui", | ||
"version": "0.0.10", | ||
"version": "0.0.11", | ||
"module": "esm/index.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
275350
6340