Skip to content

Commit

Permalink
Set displayName properly when patching React locally. (vercel#1053)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
arunoda authored and timneutkens committed Feb 9, 2017
1 parent bfab00a commit 4534c55
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions client/patch-react.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 4534c55

Please sign in to comment.