Skip to content

Commit

Permalink
Add context provider/consumer to getComponentName (facebook#12778)
Browse files Browse the repository at this point in the history
RN Inspector uses these.
  • Loading branch information
sophiebits authored May 14, 2018
1 parent 2a4d2ca commit c4abfa4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/shared/getComponentName.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ import type {Fiber} from 'react-reconciler/src/ReactFiber';
import {
REACT_ASYNC_MODE_TYPE,
REACT_CALL_TYPE,
REACT_CONTEXT_TYPE,
REACT_FORWARD_REF_TYPE,
REACT_FRAGMENT_TYPE,
REACT_RETURN_TYPE,
REACT_PORTAL_TYPE,
REACT_PROFILER_TYPE,
REACT_PROVIDER_TYPE,
REACT_RETURN_TYPE,
REACT_STRICT_MODE_TYPE,
} from 'shared/ReactSymbols';

Expand All @@ -33,12 +35,16 @@ function getComponentName(fiber: Fiber): string | null {
return 'AsyncMode';
case REACT_CALL_TYPE:
return 'ReactCall';
case REACT_CONTEXT_TYPE:
return 'Context.Consumer';
case REACT_FRAGMENT_TYPE:
return 'ReactFragment';
case REACT_PORTAL_TYPE:
return 'ReactPortal';
case REACT_PROFILER_TYPE:
return `Profiler(${fiber.pendingProps.id})`;
case REACT_PROVIDER_TYPE:
return 'Context.Provider';
case REACT_RETURN_TYPE:
return 'ReactReturn';
case REACT_STRICT_MODE_TYPE:
Expand Down

0 comments on commit c4abfa4

Please sign in to comment.