diff --git a/packages/confetti-ds/hooks.js b/packages/confetti-ds/hooks.js deleted file mode 100644 index 5b5a231b..00000000 --- a/packages/confetti-ds/hooks.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from "react"; - -// Hook -function usePrevious(value) { - // The ref object is a generic container whose current property is mutable ... - // ... and can hold any value, similar to an instance property on a class - const ref = React.useRef(); - // Store current value in ref - React.useEffect(() => { - ref.current = value; - }, [value]); // Only re-run if value changes - // Return previous value (happens before update in useEffect above) - return ref.current; -} - -export { usePrevious }; diff --git a/packages/confetti-ds/package.json b/packages/confetti-ds/package.json index 955182df..b68ec80a 100644 --- a/packages/confetti-ds/package.json +++ b/packages/confetti-ds/package.json @@ -1,6 +1,6 @@ { "name": "@labcodes/confetti-ds", - "version": "0.1.0-alpha.10", + "version": "0.1.0-alpha.11", "description": "Labcodes' design system, focused on accessibility and ease to use", "main": "dist/index.js", "husky": { diff --git a/packages/confetti-ds/src/Dropdown/AbstractDropdown.js b/packages/confetti-ds/src/Dropdown/AbstractDropdown.js index 05deba4f..0e92022e 100644 --- a/packages/confetti-ds/src/Dropdown/AbstractDropdown.js +++ b/packages/confetti-ds/src/Dropdown/AbstractDropdown.js @@ -8,7 +8,7 @@ import DropdownSectionTitle from "./DropdownSectionTitle"; import DropdownOption from "./DropdownOption"; import TagDropdownItem from "./TagDropdownItem"; import TagDropdownTrigger from "./TagDropdownTrigger"; -import { usePrevious } from "../../hooks"; +import { usePrevious } from "../hooks"; export default function AbstractDropdown({ id,