From 2bc394ccae2b9efaec07a04648485dcd37fafba6 Mon Sep 17 00:00:00 2001 From: Evan Scott Date: Tue, 11 Sep 2018 23:36:15 -0500 Subject: [PATCH] acquire and show the displayName if set on ForwardRef Part 2 of https://github.com/facebook/react/pull/13615 --- backend/attachRendererFiber.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/attachRendererFiber.js b/backend/attachRendererFiber.js index 3733082661..fcf9ac57f8 100644 --- a/backend/attachRendererFiber.js +++ b/backend/attachRendererFiber.js @@ -192,7 +192,11 @@ function attachRendererFiber(hook: Hook, rid: string, renderer: ReactRenderer): case ForwardRefLazy: const functionName = getDisplayName(resolvedType.render, ''); nodeType = 'Special'; - name = functionName !== '' ? `ForwardRef(${functionName})` : 'ForwardRef'; + name = resolvedType.displayName || ( + functionName !== '' + ? `ForwardRef(${functionName})` + : 'ForwardRef' + ); children = []; break; case HostRoot: