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:
parent
bfab00a3ee
commit
4534c55968
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue