From ff48d6ca3651742d5b37bae2872731e7b914b1fd Mon Sep 17 00:00:00 2001 From: Aleksandr Gumroian Date: Tue, 30 Apr 2024 13:37:25 +0200 Subject: [PATCH] Remove useTooltip hook --- src/index.js | 2 +- src/utils/hooks.js | 22 +--------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/index.js b/src/index.js index ab37566..33daf12 100644 --- a/src/index.js +++ b/src/index.js @@ -69,7 +69,7 @@ export { withErrorMessage, } from "./utils/conditionalHOCs"; export { ErrorMessage } from "./utils/ErrorMessage"; -export { useClickOutside, useTooltip } from "./utils/hooks"; +export { useClickOutside } from "./utils/hooks"; export { toLocaleDateString } from "./utils/datetime"; export { displayCard } from "./utils/displayCard"; export { isPluginInstalled } from "./utils/isPluginInstalled"; diff --git a/src/utils/hooks.js b/src/utils/hooks.js index 49f7553..db0c465 100644 --- a/src/utils/hooks.js +++ b/src/utils/hooks.js @@ -5,8 +5,7 @@ * See /LICENSE for more information. */ -import { useState, useEffect, useRef } from "react"; -import { Tooltip } from "bootstrap/dist/js/bootstrap.bundle.min"; +import { useState, useEffect } from "react"; /** Execute callback when condition is set to true. */ export function useConditionalTimeout( @@ -41,22 +40,3 @@ export function useClickOutside(element, callback) { }; }); } - -/** useTooltip hook for Bootstrap tooltips. */ -export function useTooltip(description, placement = "top", trigger = "hover") { - const tooltipRef = useRef(); - - useEffect(() => { - const tooltip = new Tooltip(tooltipRef.current, { - title: description, - placement, - trigger, - }); - - return () => { - tooltip.dispose(); - }; - }); - - return tooltipRef; -}