Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Fix issue with Node production environment and react-transition-group's PropTypes #21

Merged
merged 2 commits into from
Jan 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/PageTransition.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,17 @@ class PageTransition extends React.Component {
PageTransition.propTypes = {
children: PropTypes.node.isRequired,
classNames: PropTypes.string.isRequired,
timeout: timeoutsShape.isRequired,
timeout: process.env.NODE_ENV !== "production" ? timeoutsShape.isRequired : null,
loadingComponent: PropTypes.element,
loadingDelay: PropTypes.number,
loadingCallbackName: PropTypes.string,
/* eslint-disable react/require-default-props */
loadingTimeout: (props, ...args) => {
let pt = timeoutsShape
if (props.loadingComponent) pt = pt.isRequired
return pt(props, ...args)
if (props.loadingComponent && process.env.NODE_ENV !== "production"){
pt = pt.isRequired
return pt(props, ...args)
}
},
loadingClassNames: (props, ...args) => {
let pt = PropTypes.string
Expand Down