提交 4534c559 编写于 作者: A Arunoda Susiripala 提交者: 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.
上级 bfab00a3
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册