Enforce some naming conventions (#4813)

This commit is contained in:
Sebastian Malton authored and GitHub committed 2022-03-01 13:06:53 -05:00
1 parent dc6615f98f
commit 0b32775d40
197 files changed
+630 -634

No files matched your search

@@ -8,13 +8,13 @@ import React, { useEffect, useRef, useState } from "react";
import { useMutationObserver } from "../../hooks";
import type { NavigationTree } from "../tree-view";
interface Props extends React.DOMAttributes<HTMLElement> {
export interface ScrollSpyProps extends React.DOMAttributes<HTMLElement> {
render: (data: NavigationTree[]) => JSX.Element;
htmlFor?: string; // Id of the element to put observers on
rootMargin?: string; // https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API#creating_an_intersection_observer
}
export const ScrollSpy = observer(({ render, htmlFor, rootMargin = "0px 0px -100% 0px" }: Props) => {
export const ScrollSpy = observer(({ render, htmlFor, rootMargin = "0px 0px -100% 0px" }: ScrollSpyProps) => {
const parent = useRef<HTMLDivElement>();
const sections = useRef<NodeListOf<HTMLElement>>();
const [tree, setTree] = useState<NavigationTree[]>([]);