Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support SSR #619

Merged
merged 3 commits into from May 6, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/Transition.js
Expand Up @@ -394,7 +394,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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we not rely on "Element" for this prop-type? My concern is equivalent to merceyz/typescript-to-proptypes#3.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem can be noticed on mui/material-ui#21858 (comment).

}),

/**
* A `function` child can be used instead of a React element. This function is
Expand Down
10 changes: 10 additions & 0 deletions 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', () => {});
});