1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

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.
This commit is contained in:
Arunoda Susiripala 2017-02-09 20:10:31 +05:30 committed by Tim Neutkens
parent bfab00a3ee
commit 4534c55968

View file

@ -107,6 +107,7 @@ function wrap (fn, around) {
// copy all properties
Object.assign(_fn, fn)
_fn.displayName = fn.displayName || fn.name
_fn.prototype = fn.prototype