next-page-transitions
Advanced tools
Comparing version 1.0.0-alpha.1 to 1.0.0-alpha.2
@@ -138,6 +138,5 @@ "use strict"; | ||
}); | ||
var children = props.children, | ||
appear = props.appear; | ||
var children = props.children; | ||
_this.state = { | ||
state: appear ? 'entered' : 'enter', | ||
state: 'enter', | ||
isIn: !shouldDelayEnter(children), | ||
@@ -219,5 +218,13 @@ currentChildren: children, | ||
this.setState({ | ||
showLoading: false | ||
}); | ||
if (this.state.showLoading) { | ||
// We'll hide the loader first and animate in the page on the next tick | ||
this.setState({ | ||
showLoading: false | ||
}); | ||
} else { | ||
// We can immediately bring in the next page! | ||
this.setState({ | ||
isIn: true | ||
}); | ||
} | ||
} | ||
@@ -242,3 +249,2 @@ }, { | ||
timeout = _props.timeout, | ||
appear = _props.appear, | ||
loadingComponent = _props.loadingComponent, | ||
@@ -261,3 +267,3 @@ loadingCallbackName = _props.loadingCallbackName; | ||
"in": this.state.isIn, | ||
appear: appear, | ||
appear: true, | ||
onEnter: this.onEnter, | ||
@@ -298,4 +304,3 @@ onEntering: this.onEntering, | ||
classNames: _propTypes.default.string.isRequired, | ||
timeout: _PropTypes.timeoutsShape, | ||
appear: _propTypes.default.bool, | ||
timeout: _PropTypes.timeoutsShape.isRequired, | ||
loadingComponent: _propTypes.default.element, | ||
@@ -330,9 +335,7 @@ loadingDelay: _propTypes.default.number, | ||
PageTransition.defaultProps = { | ||
timeout: 300, | ||
loadingComponent: null, | ||
loadingCallbackName: 'pageTransitionReadyToEnter', | ||
loadingDelay: 500, | ||
appear: true | ||
loadingDelay: 500 | ||
}; | ||
var _default = PageTransition; | ||
exports.default = _default; |
{ | ||
"name": "next-page-transitions", | ||
"version": "1.0.0-alpha.1", | ||
"version": "1.0.0-alpha.2", | ||
"description": "Simple and customizable page transitions for Next.js apps", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23679
295