diff --git a/src/SwitchTransition.js b/src/SwitchTransition.js index 0fdfc6c4..1497e40c 100644 --- a/src/SwitchTransition.js +++ b/src/SwitchTransition.js @@ -8,8 +8,7 @@ function areChildrenDifferent(oldChildren, newChildren) { if ( React.isValidElement(oldChildren) && React.isValidElement(newChildren) && - oldChildren.key != null && - oldChildren.key === newChildren.key + ((oldChildren.key == null && newChildren.key == null) || oldChildren.key === newChildren.key) ) { return false; } diff --git a/test/SwitchTransition-test.js b/test/SwitchTransition-test.js index 744e2967..f0ab9b7c 100644 --- a/test/SwitchTransition-test.js +++ b/test/SwitchTransition-test.js @@ -43,6 +43,18 @@ describe('SwitchTransition', () => { expect(wrapper.state('status')).toBe(ENTERED); }); + it('should have default status ENTERED', () => { + const wrapper = mount( + + + + + + ); + + expect(wrapper.state('status')).toBe(ENTERED); + }); + it('should have default mode: out-in', () => { const wrapper = mount(