Skip to content

Commit

Permalink
Typo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Apr 20, 2020
1 parent 9c27613 commit 0837f80
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 41 deletions.
45 changes: 20 additions & 25 deletions packages/react-devtools-shared/src/backend/ReactSymbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,69 +14,64 @@
// Since e.g. standalone DevTools runs in a separate process, it can't rely on its own ES capabilities.

export const BLOCK_NUMBER = 0xead9;
export const BLOCK_SYMBOL_STRING = 'Symbol(react.block';
export const BLOCK_SYMBOL_STRING = 'Symbol(react.block)';

export const CONCURRENT_MODE_NUMBER = 0xeacf;
export const CONCURRENT_MODE_SYMBOL_STRING = 'Symbol(react.concurrent_mode)';

export const CONTEXT_NUMBER = 0xeace;
export const CONTEXT_SYMBOL_STRING = 'Symbol(react.context';

export const CONTEXT_CONSUMER_NUMBER = 0xeace;
export const CONTEXT_CONSUMER_SYMBOL_STRING = 'Symbol(react.context)';

export const CONTEXT_PROVIDER_NUMBER = 0xeacd;
export const CONTEXT_PROVIDER_SYMBOL_STRING = 'Symbol(react.provider)';
export const CONTEXT_SYMBOL_STRING = 'Symbol(react.context)';

export const DEPRECATED_ASYNC_MODE_SYMBOL_STRING = 'Symbol(react.async_mode)';

export const ELEMENT_NUMBER = 0xeac7;
export const ELEMENT_SYMBOL_STRING = 'Symbol(react.element';
export const ELEMENT_SYMBOL_STRING = 'Symbol(react.element)';

export const DEBUG_TRACING_MODE_NUMBER = 0xeae1;
export const DEBUG_TRACING_MODE_SYMBOL_STRING = 'Symbol(react.debug_trace_mode';
export const DEBUG_TRACING_MODE_SYMBOL_STRING =
'Symbol(react.debug_trace_mode)';

export const FORWARD_REF_NUMBER = 0xead0;
export const FORWARD_REF_SYMBOL_STRING = 'Symbol(react.forward_ref';
export const FORWARD_REF_SYMBOL_STRING = 'Symbol(react.forward_ref)';

export const FRAGMENT_NUMBER = 0xeacb;
export const FRAGMENT_SYMBOL_STRING = 'Symbol(react.fragment';
export const FRAGMENT_SYMBOL_STRING = 'Symbol(react.fragment)';

export const FUNDAMENTAL_NUMBER = 0xead5;
export const FUNDAMENTAL_SYMBOL_STRING = 'Symbol(react.fundamental';
export const FUNDAMENTAL_SYMBOL_STRING = 'Symbol(react.fundamental)';

export const LAZY_NUMBER = 0xead4;
export const LAZY_SYMBOL_STRING = 'Symbol(react.lazy';
export const LAZY_SYMBOL_STRING = 'Symbol(react.lazy)';

export const MEMO_NUMBER = 0xead3;
export const MEMO_SYMBOL_STRING = 'Symbol(react.memo';
export const MEMO_SYMBOL_STRING = 'Symbol(react.memo)';

export const OPAQUE_ID_NUMBER = 0xeae0;
export const OPAQUE_ID_SYMBOL_STRING = 'Symbol(react.opaque.id';
export const OPAQUE_ID_SYMBOL_STRING = 'Symbol(react.opaque.id)';

export const PORTAL_NUMBER = 0xeaca;
export const PORTAL_SYMBOL_STRING = 'Symbol(react.portal';
export const PORTAL_SYMBOL_STRING = 'Symbol(react.portal)';

export const PROFILER_NUMBER = 0xead2;
export const PROFILER_SYMBOL_STRING = 'Symbol(react.profiler';
export const PROFILER_SYMBOL_STRING = 'Symbol(react.profiler)';

export const PROVIDER_NUMBER = 0xeacd;
export const PROVIDER_SYMBOL_STRING = 'Symbol(react.provider';
export const PROVIDER_SYMBOL_STRING = 'Symbol(react.provider)';

export const RESPONDER_NUMBER = 0xead6;
export const RESPONDER_SYMBOL_STRING = 'Symbol(react.responder';
export const RESPONDER_SYMBOL_STRING = 'Symbol(react.responder)';

export const SCOPE_NUMBER = 0xead7;
export const SCOPE_SYMBOL_STRING = 'Symbol(react.scope';
export const SCOPE_SYMBOL_STRING = 'Symbol(react.scope)';

export const SERVER_BLOCK_NUMBER = 0xeada;
export const SERVER_BLOCK_SYMBOL_STRING = 'Symbol(react.server.block';
export const SERVER_BLOCK_SYMBOL_STRING = 'Symbol(react.server.block)';

export const STRICT_MODE_NUMBER = 0xeacc;
export const STRICT_MODE_SYMBOL_STRING = 'Symbol(react.strict_mode';
export const STRICT_MODE_SYMBOL_STRING = 'Symbol(react.strict_mode)';

export const SUSPENSE_NUMBER = 0xead1;
export const SUSPENSE_SYMBOL_STRING = 'Symbol(react.suspense';
export const SUSPENSE_SYMBOL_STRING = 'Symbol(react.suspense)';

export const SUSPENSE_LIST_NUMBER = 0xead8;
export const SUSPENSE_LIST_SYMBOL_STRING = 'Symbol(react.suspense_list';
export const SUSPENSE_LIST_SYMBOL_STRING = 'Symbol(react.suspense_list)';
32 changes: 16 additions & 16 deletions packages/react-devtools-shared/src/backend/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ import {
CONCURRENT_MODE_NUMBER,
CONCURRENT_MODE_SYMBOL_STRING,
DEPRECATED_ASYNC_MODE_SYMBOL_STRING,
CONTEXT_PROVIDER_NUMBER,
CONTEXT_PROVIDER_SYMBOL_STRING,
CONTEXT_CONSUMER_NUMBER,
CONTEXT_CONSUMER_SYMBOL_STRING,
PROVIDER_NUMBER,
PROVIDER_SYMBOL_STRING,
CONTEXT_NUMBER,
CONTEXT_SYMBOL_STRING,
STRICT_MODE_NUMBER,
STRICT_MODE_SYMBOL_STRING,
PROFILER_NUMBER,
Expand Down Expand Up @@ -328,15 +328,15 @@ export function getInternalReactConstants(
case CONCURRENT_MODE_SYMBOL_STRING:
case DEPRECATED_ASYNC_MODE_SYMBOL_STRING:
return null;
case CONTEXT_PROVIDER_NUMBER:
case CONTEXT_PROVIDER_SYMBOL_STRING:
case PROVIDER_NUMBER:
case PROVIDER_SYMBOL_STRING:
// 16.3.0 exposed the context object as "context"
// PR #12501 changed it to "_context" for 16.3.1+
// NOTE Keep in sync with inspectElementRaw()
resolvedContext = fiber.type._context || fiber.type.context;
return `${resolvedContext.displayName || 'Context'}.Provider`;
case CONTEXT_CONSUMER_NUMBER:
case CONTEXT_CONSUMER_SYMBOL_STRING:
case CONTEXT_NUMBER:
case CONTEXT_SYMBOL_STRING:
// 16.3-16.5 read from "type" because the Consumer is the actual context object.
// 16.6+ should read from "type._context" because Consumer can be different (in DEV).
// NOTE Keep in sync with inspectElementRaw()
Expand Down Expand Up @@ -652,11 +652,11 @@ export function attach(
case CONCURRENT_MODE_SYMBOL_STRING:
case DEPRECATED_ASYNC_MODE_SYMBOL_STRING:
return ElementTypeOtherOrUnknown;
case CONTEXT_PROVIDER_NUMBER:
case CONTEXT_PROVIDER_SYMBOL_STRING:
case PROVIDER_NUMBER:
case PROVIDER_SYMBOL_STRING:
return ElementTypeContext;
case CONTEXT_CONSUMER_NUMBER:
case CONTEXT_CONSUMER_SYMBOL_STRING:
case CONTEXT_NUMBER:
case CONTEXT_SYMBOL_STRING:
return ElementTypeContext;
case STRICT_MODE_NUMBER:
case STRICT_MODE_SYMBOL_STRING:
Expand Down Expand Up @@ -2183,8 +2183,8 @@ export function attach(
}
}
} else if (
typeSymbol === CONTEXT_CONSUMER_NUMBER ||
typeSymbol === CONTEXT_CONSUMER_SYMBOL_STRING
typeSymbol === CONTEXT_NUMBER ||
typeSymbol === CONTEXT_SYMBOL_STRING
) {
// 16.3-16.5 read from "type" because the Consumer is the actual context object.
// 16.6+ should read from "type._context" because Consumer can be different (in DEV).
Expand All @@ -2200,8 +2200,8 @@ export function attach(
const currentType = current.type;
const currentTypeSymbol = getTypeSymbol(currentType);
if (
currentTypeSymbol === CONTEXT_PROVIDER_NUMBER ||
currentTypeSymbol === CONTEXT_PROVIDER_SYMBOL_STRING
currentTypeSymbol === PROVIDER_NUMBER ||
currentTypeSymbol === PROVIDER_SYMBOL_STRING
) {
// 16.3.0 exposed the context object as "context"
// PR #12501 changed it to "_context" for 16.3.1+
Expand Down

0 comments on commit 0837f80

Please sign in to comment.