Updated test code to include a deeply nested DIV

This commit is contained in:
Brian Vaughn committed 2019-02-27 13:05:43 -08:00
1 parent 4d9e7e75c6
commit bc4e8950f6
10 files changed
+186 -175

No files matched your search

+10 -3
View File
@@ -1,6 +1,13 @@
// @flow
import React, { Fragment, useCallback, useContext, useEffect, useMemo, useRef } from 'react';
import React, {
Fragment,
useCallback,
useContext,
useEffect,
useMemo,
useRef,
} from 'react';
import { ElementTypeClass, ElementTypeFunction } from 'src/devtools/types';
import { createRegExp } from './utils';
import { TreeContext } from './TreeContext';
@@ -26,6 +33,7 @@ export default function ElementView({ index, style }: Props) {
const element = getElementAtIndex(index);
const id = element === null ? null : element.id;
const isSelected = selectedElementID === id;
const handleDoubleClick = useCallback(() => {
if (id !== null) {
@@ -33,7 +41,7 @@ export default function ElementView({ index, style }: Props) {
}
}, [id, selectOwner]);
const ref = useRef();
const ref = useRef<HTMLSpanElement | null>(null);
useEffect(() => {
if (isSelected) {
@@ -64,7 +72,6 @@ export default function ElementView({ index, style }: Props) {
const { depth, displayName, key, type } = ((element: any): Element);
const isSelected = selectedElementID === id;
const showDollarR =
isSelected && (type === ElementTypeClass || type === ElementTypeFunction);