You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'Warning: Component "div" contains the string ref "inner". '+
144
-
'Support for string refs will be removed in a future major release. '+
145
-
'We recommend using useRef() or createRef() instead. '+
146
-
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
147
-
' in div (at **)\n'+
148
-
' in Wrapper (at **)\n'+
149
-
' in Component (at **)',
150
-
'Warning: Component "Component" contains the string ref "outer". '+
151
-
'Support for string refs will be removed in a future major release. '+
152
-
'We recommend using useRef() or createRef() instead. '+
153
-
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
154
-
' in Component (at **)',
155
-
]
156
-
: [],
157
-
);
138
+
}).toErrorDev([
139
+
'Warning: Component "div" contains the string ref "inner". '+
140
+
'Support for string refs will be removed in a future major release. '+
141
+
'We recommend using useRef() or createRef() instead. '+
142
+
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
143
+
' in div (at **)\n'+
144
+
' in Wrapper (at **)\n'+
145
+
' in Component (at **)',
146
+
'Warning: Component "Component" contains the string ref "outer". '+
147
+
'Support for string refs will be removed in a future major release. '+
148
+
'We recommend using useRef() or createRef() instead. '+
149
+
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
150
+
' in Component (at **)',
151
+
]);
158
152
});
159
153
160
154
it('should not have string refs on unmounted components',()=>{
'Warning: Component "RefsComponent" contains the string ref "myDiv". '+
106
-
'Support for string refs will be removed in a future major release. '+
107
-
'We recommend using useRef() or createRef() instead. '+
108
-
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
109
-
' in RefsComponent (at **)',
110
-
]
111
-
: [],
112
-
);
100
+
}).toErrorDev([
101
+
'Warning: Component "RefsComponent" contains the string ref "myDiv". '+
102
+
'Support for string refs will be removed in a future major release. '+
103
+
'We recommend using useRef() or createRef() instead. '+
104
+
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
'Warning: Component "div" contains the string ref "resetDiv". '+
130
-
'Support for string refs will be removed in a future major release. '+
131
-
'We recommend using useRef() or createRef() instead. '+
132
-
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
133
-
' in div (at **)\n'+
134
-
' in TestRefsComponent (at **)',
135
-
'Warning: Component "span" contains the string ref "clickLog0". '+
136
-
'Support for string refs will be removed in a future major release. '+
137
-
'We recommend using useRef() or createRef() instead. '+
138
-
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
139
-
' in span (at **)\n'+
140
-
' in ClickCounter (at **)\n'+
141
-
' in div (at **)\n'+
142
-
' in GeneralContainerComponent (at **)\n'+
143
-
' in div (at **)\n'+
144
-
' in TestRefsComponent (at **)',
145
-
]
146
-
: [],
147
-
);
126
+
}).toErrorDev([
127
+
'Warning: Component "div" contains the string ref "resetDiv". '+
128
+
'Support for string refs will be removed in a future major release. '+
129
+
'We recommend using useRef() or createRef() instead. '+
130
+
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
131
+
' in div (at **)\n'+
132
+
' in TestRefsComponent (at **)',
133
+
'Warning: Component "span" contains the string ref "clickLog0". '+
134
+
'Support for string refs will be removed in a future major release. '+
135
+
'We recommend using useRef() or createRef() instead. '+
136
+
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
'Warning: Component "A" contains the string ref "1". '+
356
-
'Support for string refs will be removed in a future major release. '+
357
-
'We recommend using useRef() or createRef() instead. '+
358
-
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
359
-
' in A (at **)',
360
-
]
361
-
: [],
362
-
);
348
+
}).toErrorDev([
349
+
'Warning: Component "A" contains the string ref "1". '+
350
+
'Support for string refs will be removed in a future major release. '+
351
+
'We recommend using useRef() or createRef() instead. '+
352
+
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
'Warning: Component "Indirection" contains the string ref "child1". '+
553
-
'Support for string refs will be removed in a future major release. '+
554
-
'We recommend using useRef() or createRef() instead. '+
555
-
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
556
-
' in Indirection (at **)\n'+
557
-
' in Parent (at **)',
558
-
]
559
-
: [],
560
-
);
541
+
}).toErrorDev([
542
+
'Warning: Component "Indirection" contains the string ref "child1". '+
543
+
'Support for string refs will be removed in a future major release. '+
544
+
'We recommend using useRef() or createRef() instead. '+
545
+
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
'Warning: Component "Root" contains the string ref "child2". '+
573
-
'Support for string refs will be removed in a future major release. '+
574
-
'We recommend using useRef() or createRef() instead. '+
575
-
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',
576
-
]
577
-
: [],
558
+
[
559
+
'Warning: Component "Root" contains the string ref "child2". '+
560
+
'Support for string refs will be removed in a future major release. '+
561
+
'We recommend using useRef() or createRef() instead. '+
562
+
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',
'Warning: Component "Foo" contains the string ref "bar". '+
1317
-
'Support for string refs will be removed in a future major release. '+
1318
-
'We recommend using useRef() or createRef() instead. '+
1319
-
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
1320
-
' in Foo (at **)',
1321
-
]
1322
-
: [],
1323
-
);
1311
+
}).toErrorDev([
1312
+
'Warning: Component "Foo" contains the string ref "bar". '+
1313
+
'Support for string refs will be removed in a future major release. '+
1314
+
'We recommend using useRef() or createRef() instead. '+
1315
+
'Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref\n'+
0 commit comments