diff --git a/src/Transition.js b/src/Transition.js index b4964bd9..981acc26 100644 --- a/src/Transition.js +++ b/src/Transition.js @@ -390,7 +390,11 @@ Transition.propTypes = { * (see * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)). */ - nodeRef: PropTypes.shape({ current: PropTypes.instanceOf(Element) }), + nodeRef: PropTypes.shape({ + current: typeof Element === 'undefined' + ? PropTypes.any + : PropTypes.instanceOf(Element) + }), /** * A `function` child can be used instead of a React element. This function is diff --git a/test/SSR-test.js b/test/SSR-test.js new file mode 100644 index 00000000..629acacd --- /dev/null +++ b/test/SSR-test.js @@ -0,0 +1,10 @@ +/** + * @jest-environment node + */ + +// test that import does not crash +import * as ReactTransitionGroup from '../src'; // eslint-disable-line no-unused-vars + +describe('SSR', () => { + it('should import react-transition-group in node env', () => {}); +});