@chakra-ui/react-use-controllable-state
Advanced tools
Comparing version 0.0.0-dev-20220912133211 to 0.0.0-dev-20220914090509
@@ -46,3 +46,3 @@ "use strict"; | ||
const value = controlled ? valueProp : uncontrolledState; | ||
const setValue = (0, import_react.useCallback)((next) => { | ||
const setValue = (0, import_react_use_callback_ref.useCallbackRef)((next) => { | ||
const setter = next; | ||
@@ -49,0 +49,0 @@ const nextValue = typeof next === "function" ? setter(value) : next; |
// src/index.ts | ||
import { useCallback, useMemo, useState } from "react"; | ||
import { useMemo, useState } from "react"; | ||
import { useCallbackRef } from "@chakra-ui/react-use-callback-ref"; | ||
@@ -21,3 +21,3 @@ function useControllableProp(prop, state) { | ||
const value = controlled ? valueProp : uncontrolledState; | ||
const setValue = useCallback((next) => { | ||
const setValue = useCallbackRef((next) => { | ||
const setter = next; | ||
@@ -24,0 +24,0 @@ const nextValue = typeof next === "function" ? setter(value) : next; |
{ | ||
"name": "@chakra-ui/react-use-controllable-state", | ||
"version": "0.0.0-dev-20220912133211", | ||
"version": "0.0.0-dev-20220914090509", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
7427