@@ -215,7 +215,6 @@ describe('ReactComponentLifeCycle', () => {
215
215
'StatefulComponent: It is not recommended to assign props directly to state ' +
216
216
"because updates to props won't be reflected in state. " +
217
217
'In most cases, it is better to use props directly.',
218
- {withoutStack: true},
219
218
);
220
219
});
221
220
@@ -240,7 +239,6 @@ describe('ReactComponentLifeCycle', () => {
240
239
'This is a no-op, but it might indicate a bug in your application. ' +
241
240
'Instead, assign to `this.state` directly or define a `state = {};` ' +
242
241
'class property with the desired state in the StatefulComponent component.',
243
- {withoutStack: true},
244
242
);
245
243
246
244
// Check deduplication; (no extra warnings should be logged).
@@ -271,9 +269,7 @@ describe('ReactComponentLifeCycle', () => {
271
269
expect(() => {
272
270
const instance = ReactTestUtils.renderIntoDocument(element);
273
271
expect(instance._isMounted()).toBeTruthy();
274
- }).toWarnDev('Component is accessing isMounted inside its render()', {
275
- withoutStack: true,
276
- });
272
+ }).toWarnDev('Component is accessing isMounted inside its render()');
277
273
});
278
274
279
275
it('should correctly determine if a null component is mounted', () => {
@@ -300,9 +296,7 @@ describe('ReactComponentLifeCycle', () => {
300
296
expect(() => {
301
297
const instance = ReactTestUtils.renderIntoDocument(element);
302
298
expect(instance._isMounted()).toBeTruthy();
303
- }).toWarnDev('Component is accessing isMounted inside its render()', {
304
- withoutStack: true,
305
- });
299
+ }).toWarnDev('Component is accessing isMounted inside its render()');
306
300
});
307
301
308
302
it('isMounted should return false when unmounted', () => {
@@ -340,9 +334,7 @@ describe('ReactComponentLifeCycle', () => {
340
334
341
335
expect(() => {
342
336
ReactTestUtils.renderIntoDocument(<Component />);
343
- }).toWarnDev('Component is accessing findDOMNode inside its render()', {
344
- withoutStack: true,
345
- });
337
+ }).toWarnDev('Component is accessing findDOMNode inside its render()');
346
338
});
347
339
348
340
it('should carry through each of the phases of setup', () => {
@@ -408,7 +400,6 @@ describe('ReactComponentLifeCycle', () => {
408
400
instance = ReactDOM.render(<LifeCycleComponent />, container);
409
401
}).toWarnDev(
410
402
'LifeCycleComponent is accessing isMounted inside its render() function',
411
- {withoutStack: true},
412
403
);
413
404
414
405
// getInitialState
@@ -705,7 +696,6 @@ describe('ReactComponentLifeCycle', () => {
705
696
expect(() => {
706
697
expect(() => ReactDOM.render(<Component />, container)).toWarnDev(
707
698
'Unsafe legacy lifecycles will not be called for components using new component APIs.',
708
- {withoutStack: true},
709
699
);
710
700
}).toLowPriorityWarnDev(
711
701
[
@@ -744,7 +734,6 @@ describe('ReactComponentLifeCycle', () => {
744
734
ReactDOM.render(<Component value={1} />, container),
745
735
).toWarnDev(
746
736
'Unsafe legacy lifecycles will not be called for components using new component APIs.',
747
- {withoutStack: true},
748
737
);
749
738
}).toLowPriorityWarnDev(
750
739
[
@@ -780,7 +769,6 @@ describe('ReactComponentLifeCycle', () => {
780
769
const container = document.createElement('div');
781
770
expect(() => ReactDOM.render(<Component value={1} />, container)).toWarnDev(
782
771
'Unsafe legacy lifecycles will not be called for components using new component APIs.',
783
- {withoutStack: true},
784
772
);
785
773
ReactDOM.render(<Component value={2} />, container);
786
774
});
@@ -812,7 +800,6 @@ describe('ReactComponentLifeCycle', () => {
812
800
' componentWillUpdate\n\n' +
813
801
'The above lifecycles should be removed. Learn more about this warning here:\n' +
814
802
'https://fb.me/react-unsafe-component-lifecycles',
815
- {withoutStack: true},
816
803
);
817
804
}).toLowPriorityWarnDev(
818
805
[
@@ -839,7 +826,6 @@ describe('ReactComponentLifeCycle', () => {
839
826
' UNSAFE_componentWillMount\n\n' +
840
827
'The above lifecycles should be removed. Learn more about this warning here:\n' +
841
828
'https://fb.me/react-unsafe-component-lifecycles',
842
- {withoutStack: true},
843
829
);
844
830
845
831
class WillMountAndUpdate extends React.Component {
@@ -864,7 +850,6 @@ describe('ReactComponentLifeCycle', () => {
864
850
' UNSAFE_componentWillUpdate\n\n' +
865
851
'The above lifecycles should be removed. Learn more about this warning here:\n' +
866
852
'https://fb.me/react-unsafe-component-lifecycles',
867
- {withoutStack: true},
868
853
);
869
854
}).toLowPriorityWarnDev(['componentWillMount has been renamed'], {
870
855
withoutStack: true,
@@ -888,7 +873,6 @@ describe('ReactComponentLifeCycle', () => {
888
873
' componentWillReceiveProps\n\n' +
889
874
'The above lifecycles should be removed. Learn more about this warning here:\n' +
890
875
'https://fb.me/react-unsafe-component-lifecycles',
891
- {withoutStack: true},
892
876
);
893
877
}).toLowPriorityWarnDev(['componentWillReceiveProps has been renamed'], {
894
878
withoutStack: true,
@@ -921,7 +905,6 @@ describe('ReactComponentLifeCycle', () => {
921
905
' componentWillUpdate\n\n' +
922
906
'The above lifecycles should be removed. Learn more about this warning here:\n' +
923
907
'https://fb.me/react-unsafe-component-lifecycles',
924
- {withoutStack: true},
925
908
);
926
909
}).toLowPriorityWarnDev(
927
910
[
@@ -947,7 +930,6 @@ describe('ReactComponentLifeCycle', () => {
947
930
' UNSAFE_componentWillMount\n\n' +
948
931
'The above lifecycles should be removed. Learn more about this warning here:\n' +
949
932
'https://fb.me/react-unsafe-component-lifecycles',
950
- {withoutStack: true},
951
933
);
952
934
953
935
class WillMountAndUpdate extends React.Component {
@@ -971,7 +953,6 @@ describe('ReactComponentLifeCycle', () => {
971
953
' UNSAFE_componentWillUpdate\n\n' +
972
954
'The above lifecycles should be removed. Learn more about this warning here:\n' +
973
955
'https://fb.me/react-unsafe-component-lifecycles',
974
- {withoutStack: true},
975
956
);
976
957
}).toLowPriorityWarnDev(['componentWillMount has been renamed'], {
977
958
withoutStack: true,
@@ -994,7 +975,6 @@ describe('ReactComponentLifeCycle', () => {
994
975
' componentWillReceiveProps\n\n' +
995
976
'The above lifecycles should be removed. Learn more about this warning here:\n' +
996
977
'https://fb.me/react-unsafe-component-lifecycles',
997
- {withoutStack: true},
998
978
);
999
979
}).toLowPriorityWarnDev(['componentWillReceiveProps has been renamed'], {
1000
980
withoutStack: true,
@@ -1045,7 +1025,6 @@ describe('ReactComponentLifeCycle', () => {
1045
1025
"If you can't use a class try assigning the prototype on the function as a workaround. " +
1046
1026
'`Parent.prototype = React.Component.prototype`. ' +
1047
1027
"Don't use an arrow function since it cannot be called with `new` by React.",
1048
- {withoutStack: true},
1049
1028
);
1050
1029
ReactDOM.render(<Parent ref={c => c && log.push('ref')} />, div);
1051
1030
@@ -1074,7 +1053,6 @@ describe('ReactComponentLifeCycle', () => {
1074
1053
expect(() => ReactDOM.render(<MyComponent />, div)).toWarnDev(
1075
1054
'MyComponent.getDerivedStateFromProps(): A valid state object (or null) must ' +
1076
1055
'be returned. You have returned undefined.',
1077
- {withoutStack: true},
1078
1056
);
1079
1057
1080
1058
// De-duped
@@ -1097,7 +1075,6 @@ describe('ReactComponentLifeCycle', () => {
1097
1075
'undefined. This is not recommended. Instead, define the initial state by ' +
1098
1076
'assigning an object to `this.state` in the constructor of `MyComponent`. ' +
1099
1077
'This ensures that `getDerivedStateFromProps` arguments have a consistent shape.',
1100
- {withoutStack: true},
1101
1078
);
1102
1079
1103
1080
// De-duped
@@ -1366,7 +1343,6 @@ describe('ReactComponentLifeCycle', () => {
1366
1343
expect(() => ReactDOM.render(<MyComponent value="bar" />, div)).toWarnDev(
1367
1344
'MyComponent.getSnapshotBeforeUpdate(): A snapshot value (or null) must ' +
1368
1345
'be returned. You have returned undefined.',
1369
- {withoutStack: true},
1370
1346
);
1371
1347
1372
1348
// De-duped
@@ -1387,7 +1363,6 @@ describe('ReactComponentLifeCycle', () => {
1387
1363
expect(() => ReactDOM.render(<MyComponent />, div)).toWarnDev(
1388
1364
'MyComponent: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). ' +
1389
1365
'This component defines getSnapshotBeforeUpdate() only.',
1390
- {withoutStack: true},
1391
1366
);
1392
1367
1393
1368
// De-duped
0 commit comments