Commit 4534c559 authored by Arunoda Susiripala's avatar Arunoda Susiripala Committed by Tim Neutkens

Set displayName properly when patching React locally. (#1053)

* Using styled-jsx for with-jest example.

* Set the displayName of the wraped components.
Otherwise it won't get the correct displayName if the
original component doesn't provide it by using it's function name.
parent bfab00a3
...@@ -107,6 +107,7 @@ function wrap (fn, around) { ...@@ -107,6 +107,7 @@ function wrap (fn, around) {
// copy all properties // copy all properties
Object.assign(_fn, fn) Object.assign(_fn, fn)
_fn.displayName = fn.displayName || fn.name
_fn.prototype = fn.prototype _fn.prototype = fn.prototype
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment