From 26d91be36f8968b8700b8f9e79e9dc9fb261fef8 Mon Sep 17 00:00:00 2001 From: Juliana Barros Lima <12106738+tiidadavena@users.noreply.github.com> Date: Thu, 29 Dec 2022 18:30:35 -0300 Subject: [PATCH] [CSYS-392] release 0.1.0-alpha 10 crashing tests labrary (#56) * fix: updating the hooks import * fix: removing the duplicated hook * fix: updating the Confetti's version --- packages/confetti-ds/hooks.js | 16 ---------------- packages/confetti-ds/package.json | 2 +- .../confetti-ds/src/Dropdown/AbstractDropdown.js | 2 +- 3 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 packages/confetti-ds/hooks.js 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,