Skip to content
This repository was archived by the owner on Feb 21, 2023. It is now read-only.

Commit 1ba65ef

Browse files
committed
prepend UNSAFE_
1 parent 84153c0 commit 1ba65ef

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

__test__/BlockUi.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ describe('BlockUi', function() {
409409
const instance = wrapper.instance();
410410
instance.helper = { parentNode: { contains: sinon.stub().returns(true) } };
411411
wrapper.find('input').simulate('click');
412-
instance.componentWillReceiveProps({ blocking: true });
412+
instance.UNSAFE_componentWillReceiveProps({ blocking: true });
413413
expect(instance.focused).to.equal(document.activeElement);
414414
expect(instance.helper.parentNode.contains).to.have.been.called;
415415
});
@@ -419,7 +419,7 @@ describe('BlockUi', function() {
419419
const wrapper = shallow(<BlockUi keepInView><input /></BlockUi>);
420420
const instance = wrapper.instance();
421421
sinon.spy(window, 'addEventListener');
422-
instance.componentWillReceiveProps({ blocking: true, keepInView: true });
422+
instance.UNSAFE_componentWillReceiveProps({ blocking: true, keepInView: true });
423423
expect(window.addEventListener).to.have.been.calledWith('scroll', instance.handleScroll);
424424
window.addEventListener.restore();
425425
});
@@ -431,7 +431,7 @@ describe('BlockUi', function() {
431431
const wrapper = shallow(<BlockUi blocking><input /></BlockUi>);
432432
const instance = wrapper.instance();
433433
sinon.spy(window, 'addEventListener');
434-
instance.componentWillReceiveProps({ blocking: true, keepInView: true });
434+
instance.UNSAFE_componentWillReceiveProps({ blocking: true, keepInView: true });
435435
expect(window.addEventListener).to.have.been.calledWith('scroll', instance.handleScroll);
436436
window.addEventListener.restore();
437437
});
@@ -444,7 +444,7 @@ describe('BlockUi', function() {
444444
const instance = wrapper.instance();
445445
const spy = sinon.spy();
446446
instance.focused = { focus: spy };
447-
instance.componentWillReceiveProps({ blocking: false });
447+
instance.UNSAFE_componentWillReceiveProps({ blocking: false });
448448
expect(spy).to.have.been.called;
449449
});
450450
});
@@ -453,15 +453,15 @@ describe('BlockUi', function() {
453453
const wrapper = shallow(<BlockUi blocking><input /></BlockUi>);
454454
const instance = wrapper.instance();
455455
instance.focused = null;
456-
expect(instance.componentWillReceiveProps.bind(instance, { blocking: false })).to.not.throw;
456+
expect(instance.UNSAFE_componentWillReceiveProps.bind(instance, { blocking: false })).to.not.throw;
457457
});
458458
});
459459
describe('keepInView', () => {
460460
it('should remove a scroll listener', () => {
461461
const wrapper = shallow(<BlockUi blocking><input /></BlockUi>);
462462
const instance = wrapper.instance();
463463
sinon.spy(window, 'removeEventListener');
464-
instance.componentWillReceiveProps({ blocking: false });
464+
instance.UNSAFE_componentWillReceiveProps({ blocking: false });
465465
expect(window.removeEventListener).to.have.been.calledWith('scroll', instance.handleScroll);
466466
window.removeEventListener.restore();
467467
});

src/BlockUi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class BlockUi extends Component {
2828
}
2929

3030

31-
componentWillReceiveProps(nextProps) {
31+
UNSAFE_componentWillReceiveProps(nextProps) {
3232
if (nextProps.blocking !== this.props.blocking) {
3333
if (nextProps.blocking) {
3434
// blocking started

src/ReduxBlockUi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class ReduxBlockUi extends Component {
1515
};
1616
}
1717

18-
componentWillMount() {
18+
UNSAFE_componentWillMount() {
1919
register(this.middleware);
2020
}
2121

0 commit comments

Comments
 (0)