File tree 1 file changed +15
-9
lines changed
1 file changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -156,15 +156,21 @@ class ReactDebugMacro
156
156
157
157
if (cond )
158
158
{
159
- // Using Object.create(null) to avoid prototype for clean output
160
- var debugProps = untyped Object .create (null );
161
- debugProps .currentProps = this .props ;
162
- debugProps .prevProps = $i {prevProps };
163
-
164
- js. Browser .console .warn (
165
- ' Warning: avoidable re-render of ` ${$v {inClass .name }}`. \n ' ,
166
- debugProps
167
- );
159
+ ${hasProps ? macro {
160
+ // Using Object.create(null) to avoid prototype for clean output
161
+ var debugProps = untyped Object .create (null );
162
+ debugProps .currentProps = this .props ;
163
+ debugProps .prevProps = $i {prevProps };
164
+
165
+ js. Browser .console .warn (
166
+ ' Warning: avoidable re-render of ` ${$v {inClass .name }}`. \n ' ,
167
+ debugProps
168
+ );
169
+ } : macro {
170
+ js. Browser .console .warn (
171
+ ' Warning: avoidable re-render of ` ${$v {inClass .name }}`.'
172
+ );
173
+ }};
168
174
169
175
if (react. ReactDebugMacro .firstRenderWarning )
170
176
{
You can’t perform that action at this time.
0 commit comments