From c37509727fe220f0276da3343108675d2a8fd43d Mon Sep 17 00:00:00 2001 From: Ben Alpert Date: Sun, 31 May 2015 12:44:18 -0700 Subject: [PATCH] Set constructor properly in createReactNativeComponentClass Summary: Without this, the displayName property wasn't found when looking at `.constructor` on a component instance. Fixes facebook/react-devtools#92. Closes https://github.com/facebook/react-native/pull/1471 Github Author: Ben Alpert Test Plan: Used devtools on MoviesApp and saw RCTView instead of Unknown: {F22491590} --- Libraries/ReactNative/createReactNativeComponentClass.js | 1 + 1 file changed, 1 insertion(+) diff --git a/Libraries/ReactNative/createReactNativeComponentClass.js b/Libraries/ReactNative/createReactNativeComponentClass.js index c821cfa75..65af58d5e 100644 --- a/Libraries/ReactNative/createReactNativeComponentClass.js +++ b/Libraries/ReactNative/createReactNativeComponentClass.js @@ -36,6 +36,7 @@ var createReactNativeComponentClass = function( }; Constructor.displayName = viewConfig.uiViewClassName; Constructor.prototype = new ReactNativeBaseComponent(viewConfig); + Constructor.prototype.constructor = Constructor; return Constructor; };