Skip to content

Commit dc503e4

Browse files
author
Jan Fischer
committed
fix: react 17 Timeline target
1 parent b2d2666 commit dc503e4

File tree

8 files changed

+12
-10
lines changed

8 files changed

+12
-10
lines changed

.eslintrc

Whitespace-only changes.

packages/docz/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"gsap": "^3.2.6",
2424
"react": "^16.8.6",
2525
"react-dom": "^16.8.6",
26-
"react-gsap": "3.2.0"
26+
"react-gsap": "3.2.1"
2727
},
2828
"devDependencies": {
2929
"@types/react": "^16.8.23",

packages/next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"next": "^9.5.1",
1313
"react": "^16.12.0",
1414
"react-dom": "^16.12.0",
15-
"react-gsap": "3.2.0"
15+
"react-gsap": "3.2.1"
1616
},
1717
"devDependencies": {
1818
"@types/node": "^14.14.22",

packages/playground/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"gsap": "^3.2.6",
1818
"react": "^16.13.1",
1919
"react-dom": "^16.13.1",
20-
"react-gsap": "3.2.0",
20+
"react-gsap": "3.2.1",
2121
"react-router-dom": "^5.1.2",
2222
"react-scripts": "4.0.1",
2323
"react-transition-group": "^4.3.0",

packages/playground/src/examples/Transition.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ const TransitionItem = ({
3636
paused={true}
3737
playState={
3838
state === 'entering'
39-
? PlayState.reverse
39+
? PlayState.restartReverse
4040
: state === 'exiting'
41-
? PlayState.play
41+
? PlayState.restart
4242
: undefined
4343
}
4444
ease="Back.easeInOut"

packages/react-gsap/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-gsap",
3-
"version": "3.2.0",
3+
"version": "3.2.1",
44
"description": "React components for GSAP",
55
"author": "bitworking",
66
"license": "MIT",

packages/react-gsap/src/helper.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ function isDOMTypeElement(element: any) {
177177

178178
// https://stackoverflow.com/a/39165137
179179
function getReactNode(dom: any, traverseUp = 0) {
180-
const key = Object.keys(dom ?? {}).find(key => key.startsWith('__reactInternalInstance$'));
180+
const key = Object.keys(dom ?? {}).find(
181+
key => key.startsWith('__reactInternalInstance$') || key.startsWith('__reactFiber$')
182+
);
181183

182184
const domFiber = key && dom[key];
183185
if (!domFiber) return null;

packages/react-gsap/src/tools/Scroller.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ class Scroller extends Provider<ScrollerProps, ScrollerState> {
134134

135135
let progress = 0;
136136

137-
if (triggerPosition == TriggerPosition.top) {
137+
if (triggerPosition === TriggerPosition.top) {
138138
const height = entry.boundingClientRect.height;
139139
const top = entry.boundingClientRect.top;
140140
const position = top <= 0 ? -top : 0;
141141
progress = position / height;
142-
} else if (triggerPosition == TriggerPosition.bottom) {
142+
} else if (triggerPosition === TriggerPosition.bottom) {
143143
const height = entry.boundingClientRect.height;
144144
const position = height - Math.max(Math.min(entry.boundingClientRect.top, height), 0);
145145
progress = position / height;
@@ -168,7 +168,7 @@ class Scroller extends Provider<ScrollerProps, ScrollerState> {
168168
};
169169

170170
getTotalProgress(progresses: number[]) {
171-
const length = progresses.length;
171+
// const length = progresses.length;
172172
return progresses.reduceRight((previousValue, currentValue) => {
173173
if (previousValue) {
174174
return Math.min(currentValue || 1, 1) + previousValue;

0 commit comments

Comments
 (0)