diff --git a/website/src/components/detailsToggle/index.js b/website/src/components/detailsToggle/index.js index 9f69d60aba6..d337ece096c 100644 --- a/website/src/components/detailsToggle/index.js +++ b/website/src/components/detailsToggle/index.js @@ -1,17 +1,13 @@ -import React, { useState, useEffect } from 'react'; +import React, { useState } from 'react'; import styles from './styles.module.css'; function detailsToggle({ children, alt_header = null }) { const [isOn, setOn] = useState(false); - const [hoverTimeout, setHoverTimeout] = useState(null); const handleToggleClick = () => { setOn(current => !current); }; - useEffect(() => { - return () => clearTimeout(hoverTimeout); - }, [hoverTimeout]); return (
diff --git a/website/src/components/faqs/index.js b/website/src/components/faqs/index.js index ccacaf66071..377bc089555 100644 --- a/website/src/components/faqs/index.js +++ b/website/src/components/faqs/index.js @@ -6,7 +6,6 @@ function FAQ({ path, alt_header = null }) { const [isOn, setOn] = useState(false); const [filePath, setFilePath] = useState(path); const [fileContent, setFileContent] = useState({}); - const [hoverTimeout, setHoverTimeout] = useState(null); // Get all faq file paths from plugin const { faqFiles } = usePluginData('docusaurus-build-global-data-plugin'); @@ -37,21 +36,9 @@ function FAQ({ path, alt_header = null }) { } }, [filePath]) - - useEffect(() => { - return () => { - if (hoverTimeout) { - clearTimeout(hoverTimeout); - } - }; - }, [hoverTimeout]); - - const toggleOn = () => { - if (hoverTimeout) { - clearTimeout(hoverTimeout); - } + const toggleOn = function () { setOn(!isOn); - }; + } return (