Skip to content

Commit

Permalink
remove commented out code
Browse files Browse the repository at this point in the history
  • Loading branch information
spmonahan committed Mar 29, 2024
1 parent 55aa021 commit a994c4e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions packages/react-hooks/src/useTarget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ export function useTarget<TElement extends HTMLElement = HTMLElement>(
const currentElement = hostElement?.current;
if (target) {
if (typeof target === 'string') {
// const currentDoc: Document = getDocument(currentElement)!;
// targetRef.current = currentDoc ? currentDoc.querySelector(target) : null;

// If element is part of shadow dom, then querySelector on shadow root, else query on document
if ((currentElement?.getRootNode() as ShadowRoot)?.host) {
targetRef.current = (currentElement?.getRootNode() as ShadowRoot)?.querySelector(target) ?? null;
Expand Down

0 comments on commit a994c4e

Please sign in to comment.