aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/hooks/use-headings-tree.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/hooks/use-headings-tree.tsx')
-rw-r--r--src/utils/hooks/use-headings-tree.tsx6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/utils/hooks/use-headings-tree.tsx b/src/utils/hooks/use-headings-tree.tsx
index 0dc077e..049ab29 100644
--- a/src/utils/hooks/use-headings-tree.tsx
+++ b/src/utils/hooks/use-headings-tree.tsx
@@ -1,5 +1,5 @@
import { useCallback, useEffect, useMemo, useState } from 'react';
-import { slugify } from '../helpers/strings';
+import { slugify } from '../helpers';
import { useMutationObserver } from './use-mutation-observer';
export type Heading = {
@@ -27,7 +27,7 @@ export type Heading = {
* @param {HTMLElement} wrapper - An HTML element that contains the headings.
* @returns {Heading[]} The headings tree.
*/
-const useHeadingsTree = (wrapper: HTMLElement): Heading[] => {
+export const useHeadingsTree = (wrapper: HTMLElement): Heading[] => {
const depths = useMemo(() => ['h2', 'h3', 'h4', 'h5', 'h6'], []);
const [allHeadings, setAllHeadings] =
useState<NodeListOf<HTMLHeadingElement>>();
@@ -160,5 +160,3 @@ const useHeadingsTree = (wrapper: HTMLElement): Heading[] => {
return headingsTree;
};
-
-export default useHeadingsTree;