@yamada-ui/use-controllable-state
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -34,3 +34,4 @@ "use strict"; | ||
const [defaultValue, setDefaultValue] = (0, import_react.useState)(props.defaultValue); | ||
const controlled = props.value !== void 0; | ||
const controlledRef = (0, import_react.useRef)(props.value !== void 0); | ||
const controlled = controlledRef.current; | ||
const value = controlled ? props.value : defaultValue; | ||
@@ -37,0 +38,0 @@ const setValue = (0, import_utils.useCallbackRef)( |
{ | ||
"name": "@yamada-ui/use-controllable-state", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Yamada UI useControllableState custom hook", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
6557
89