@chakra-ui/color-mode
Advanced tools
Comparing version 1.1.1 to 1.1.2
# Change Log | ||
## 1.1.2 | ||
### Patch Changes | ||
- [`d70515fc2`](https://github.com/chakra-ui/chakra-ui/commit/d70515fc20279b5b2acf9a2db2bda0289b8c5408) | ||
Thanks [@segunadebayo](https://github.com/segunadebayo)! - Fix: memoize the | ||
context value for `ColorModeProvider` | ||
- Updated dependencies | ||
[[`e748219f3`](https://github.com/chakra-ui/chakra-ui/commit/e748219f300f0c51b0eb304fce38b014d7bcbc86), | ||
[`9c143bfe5`](https://github.com/chakra-ui/chakra-ui/commit/9c143bfe5bbf180929fabb0a1b4c18d40f7fd3fc), | ||
[`91ef14839`](https://github.com/chakra-ui/chakra-ui/commit/91ef148397187010804eb8f30307d2ec94c32c5b)]: | ||
- @chakra-ui/hooks@1.2.0 | ||
- @chakra-ui/utils@1.4.0 | ||
## 1.1.1 | ||
@@ -4,0 +19,0 @@ |
@@ -114,7 +114,9 @@ "use strict"; | ||
var context = { | ||
colorMode: value != null ? value : colorMode, | ||
toggleColorMode: value ? _utils.noop : toggleColorMode, | ||
setColorMode: value ? _utils.noop : setColorMode | ||
}; | ||
var context = React.useMemo(function () { | ||
return { | ||
colorMode: value != null ? value : colorMode, | ||
toggleColorMode: value ? _utils.noop : toggleColorMode, | ||
setColorMode: value ? _utils.noop : setColorMode | ||
}; | ||
}, [colorMode, setColorMode, toggleColorMode, value]); | ||
return /*#__PURE__*/React.createElement(ColorModeContext.Provider, { | ||
@@ -121,0 +123,0 @@ value: context |
@@ -94,7 +94,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | ||
var context = { | ||
var context = React.useMemo(() => ({ | ||
colorMode: value != null ? value : colorMode, | ||
toggleColorMode: value ? noop : toggleColorMode, | ||
setColorMode: value ? noop : setColorMode | ||
}; | ||
}), [colorMode, setColorMode, toggleColorMode, value]); | ||
return /*#__PURE__*/React.createElement(ColorModeContext.Provider, { | ||
@@ -101,0 +101,0 @@ value: context |
{ | ||
"name": "@chakra-ui/color-mode", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "React component and hooks for handling light and dark mode.", | ||
@@ -60,4 +60,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@chakra-ui/hooks": "1.1.5", | ||
"@chakra-ui/utils": "1.3.0" | ||
"@chakra-ui/hooks": "1.2.0", | ||
"@chakra-ui/utils": "1.4.0" | ||
}, | ||
@@ -64,0 +64,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
81107
777
+ Added@chakra-ui/hooks@1.2.0(transitive)
+ Added@chakra-ui/utils@1.4.0(transitive)
- Removed@chakra-ui/hooks@1.1.5(transitive)
- Removed@chakra-ui/utils@1.3.0(transitive)
Updated@chakra-ui/hooks@1.2.0
Updated@chakra-ui/utils@1.4.0