Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ function HookView({

let name = hook.name;
if (enableProfilerChangedHookIndices) {
if (!isCustomHook) {
if (hookID !== null) {
name = (
<>
<span className={styles.PrimitiveHookNumber}>{hookID + 1}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@

import * as React from 'react';
import {
createContext,
forwardRef,
Fragment,
memo,
useCallback,
useContext,
useDebugValue,
useEffect,
useState,
Expand Down Expand Up @@ -64,8 +66,13 @@ function useDeepHookF() {
useDebugValue('useDeepHookF');
}

const ContextA = createContext('A');
const ContextB = createContext('B');

function FunctionWithHooks(props: any, ref: React$Ref<any>) {
const [count, updateCount] = useState(0);
// eslint-disable-next-line no-unused-vars
const contextValueA = useContext(ContextA);

// eslint-disable-next-line no-unused-vars
const [_, __] = useState(object);
Expand All @@ -85,6 +92,9 @@ function FunctionWithHooks(props: any, ref: React$Ref<any>) {
// Tests nested custom hooks
useNestedOuterHook();

// eslint-disable-next-line no-unused-vars
const contextValueB = useContext(ContextB);

// Verify deep nesting doesn't break
useDeepHookA();

Expand Down