Skip to content
Open
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 @@ -51,7 +51,7 @@ if (__DEV__) {
componentFrameCache = new PossiblyWeakMap<$FlowFixMe, string>();
}

export function describeNativeComponentFrame(
export function describeFunctionComponentFrame(
fn: Function,
construct: boolean,
currentDispatcherRef: CurrentDispatcherRef,
Expand Down Expand Up @@ -280,12 +280,5 @@ export function describeClassComponentFrame(
ctor: Function,
currentDispatcherRef: CurrentDispatcherRef,
): string {
return describeNativeComponentFrame(ctor, true, currentDispatcherRef);
}

export function describeFunctionComponentFrame(
fn: Function,
currentDispatcherRef: CurrentDispatcherRef,
): string {
return describeNativeComponentFrame(fn, false, currentDispatcherRef);
return describeFunctionComponentFrame(ctor, true, currentDispatcherRef);
}
10 changes: 3 additions & 7 deletions packages/shared/ReactComponentStackFrame.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ if (__DEV__) {
* (3) diffing the control and sample error stacks to find the stack frame
* which represents our component.
*/
export function describeNativeComponentFrame(
export function describeFunctionComponentFrame(
fn: Function,
construct: boolean,
): string {
Expand Down Expand Up @@ -291,11 +291,7 @@ export function describeNativeComponentFrame(
}

export function describeClassComponentFrame(ctor: Function): string {
return describeNativeComponentFrame(ctor, true);
}

export function describeFunctionComponentFrame(fn: Function): string {
return describeNativeComponentFrame(fn, false);
return describeFunctionComponentFrame(ctor, true);
}

function shouldConstruct(Component: Function) {
Expand All @@ -312,7 +308,7 @@ export function describeUnknownElementTypeFrameInDEV(type: any): string {
return '';
}
if (typeof type === 'function') {
return describeNativeComponentFrame(type, shouldConstruct(type));
return describeFunctionComponentFrame(type, shouldConstruct(type));
}
if (typeof type === 'string') {
return describeBuiltInComponentFrame(type);
Expand Down
Loading