page-transition 0.1.0-beta.31 → 0.1.0-beta.32

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.
@@ -57,6 +57,14 @@ export function useHandleLinkClick({ container, handleLinkClick, currentPathname
57
57
  });
58
58
  }
59
59
  });
60
+ const removeEnterAddExit = useTransitionEndObj({
61
+ transitionEndData,
62
+ fn: () => {
63
+ container.current?.classList.remove('enter');
64
+ container.current?.classList.add('exit');
65
+ state.current = 'exiting';
66
+ }
67
+ });
60
68
  handleLinkClick.current = useCallback((e, url) => {
61
69
  e.preventDefault();
62
70
  nextPage.current = url;
@@ -92,7 +100,7 @@ export function useHandleLinkClick({ container, handleLinkClick, currentPathname
92
100
  }
93
101
  if (state.current === 'entering') {
94
102
  transitionEnd({
95
- transitionEndObj: push,
103
+ transitionEndObj: removeEnterAddExit,
96
104
  transitionEndHandler,
97
105
  reverse,
98
106
  delayStep
@@ -63,10 +63,12 @@ export function usePopState({ container, currentPathname, transitionEndData, tra
63
63
  useUse.current = false;
64
64
  }
65
65
  });
66
- const debug = useTransitionEndObj({
66
+ const removeEnterAddExit = useTransitionEndObj({
67
67
  transitionEndData,
68
68
  fn: () => {
69
- console.log('debug');
69
+ container.current?.classList.remove('enter');
70
+ container.current?.classList.add('exit');
71
+ state.current = 'exiting';
70
72
  }
71
73
  });
72
74
  useEffect(() => {
@@ -105,7 +107,7 @@ export function usePopState({ container, currentPathname, transitionEndData, tra
105
107
  }
106
108
  if (state.current === 'entering') {
107
109
  transitionEnd({
108
- transitionEndObj: afterExit,
110
+ transitionEndObj: removeEnterAddExit,
109
111
  transitionEndHandler,
110
112
  reverse,
111
113
  delayStep
@@ -113,6 +115,7 @@ export function usePopState({ container, currentPathname, transitionEndData, tra
113
115
  if (state.current !== 'entering') {
114
116
  console.log('state.current !== entering');
115
117
  console.log('state:', state.current);
118
+ console.log('oben');
116
119
  return;
117
120
  }
118
121
  console.log('state.current === entering');
@@ -133,6 +136,7 @@ export function usePopState({ container, currentPathname, transitionEndData, tra
133
136
  if (state.current !== 'entering') {
134
137
  console.log('state.current !== entering');
135
138
  console.log('state:', state.current);
139
+ console.log('unten');
136
140
  return;
137
141
  }
138
142
  console.log('updatePlaybackRate done');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "page-transition",
3
- "version": "0.1.0-beta.31",
3
+ "version": "0.1.0-beta.32",
4
4
  "description": "A page transition library for the Next.js App Router.",
5
5
  "license": "MIT",
6
6
  "files": [