page-transition 0.1.0-beta.36 → 0.1.0-beta.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -131,12 +131,22 @@ export function useHandleLinkClick({ container, handleLinkClick, currentPathname
131
131
  target: 0,
132
132
  duration: duration.current ?? 0
133
133
  }).then(() => {
134
- transitionEnd({
135
- transitionEndObj: push,
136
- transitionEndHandler,
137
- reverse,
138
- delayStep
139
- });
134
+ if (basePathUrl === currentPathname.current) {
135
+ transitionEnd({
136
+ transitionEndObj: afterExit,
137
+ transitionEndHandler,
138
+ reverse,
139
+ delayStep
140
+ });
141
+ }
142
+ else {
143
+ transitionEnd({
144
+ transitionEndObj: push,
145
+ transitionEndHandler,
146
+ reverse,
147
+ delayStep
148
+ });
149
+ }
140
150
  container.current?.classList.remove('enter');
141
151
  container.current?.classList.add('exit');
142
152
  state.current = 'exiting';
@@ -134,12 +134,22 @@ export function usePopState({ container, currentPathname, transitionEndData, tra
134
134
  target: 0,
135
135
  duration: duration.current ?? 0
136
136
  }).then(() => {
137
- transitionEnd({
138
- transitionEndObj: pop,
139
- transitionEndHandler,
140
- reverse,
141
- delayStep
142
- });
137
+ if (currentPathname.current === window.location.pathname) {
138
+ transitionEnd({
139
+ transitionEndObj: afterExit,
140
+ transitionEndHandler,
141
+ reverse,
142
+ delayStep
143
+ });
144
+ }
145
+ else {
146
+ transitionEnd({
147
+ transitionEndObj: pop,
148
+ transitionEndHandler,
149
+ reverse,
150
+ delayStep
151
+ });
152
+ }
143
153
  container.current?.classList.remove('enter');
144
154
  container.current?.classList.add('exit');
145
155
  state.current = 'exiting';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "page-transition",
3
- "version": "0.1.0-beta.36",
3
+ "version": "0.1.0-beta.37",
4
4
  "description": "A page transition library for the Next.js App Router.",
5
5
  "license": "MIT",
6
6
  "files": [