Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add context provider/consumer to getComponentName #12778

Merged
merged 1 commit into from
May 14, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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