-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Upgrade React Transition Group #3706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f7fc9f9
Upgrade React Transition Group
snowystinger ac74835
fix lint
snowystinger f8f6682
Merge branch 'main' into upgrade-react-transition-group
snowystinger 965ee6c
simplify tests
snowystinger b4a2df3
fix lint
snowystinger 0458bf3
Merge branch 'main' into upgrade-react-transition-group
snowystinger e4d5d47
Merge branch 'main' into upgrade-react-transition-group
snowystinger 9d6194e
Merge branch 'main' into upgrade-react-transition-group
snowystinger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,22 +80,37 @@ export function useVirtualizerState<T extends object, V, W>(opts: VirtualizerPro | |
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, []); | ||
|
||
return { | ||
let setVisibleRect = useCallback((rect) => { | ||
virtualizer.visibleRect = rect; | ||
}, [virtualizer]); | ||
let startScrolling = useCallback(() => { | ||
virtualizer.startScrolling(); | ||
setScrolling(true); | ||
}, [virtualizer]); | ||
let endScrolling = useCallback(() => { | ||
virtualizer.endScrolling(); | ||
setScrolling(false); | ||
}, [virtualizer]); | ||
|
||
let state = useMemo(() => ({ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. memo state so it doesn't cause unnecessary onLoadMore calls, this appeared after blurring the combobox and it beginning to exit in 16 and 17 |
||
virtualizer, | ||
visibleViews, | ||
setVisibleRect: useCallback((rect) => { | ||
virtualizer.visibleRect = rect; | ||
}, [virtualizer]), | ||
setVisibleRect, | ||
contentSize, | ||
isAnimating, | ||
isScrolling, | ||
startScrolling: useCallback(() => { | ||
virtualizer.startScrolling(); | ||
setScrolling(true); | ||
}, [virtualizer]), | ||
endScrolling: useCallback(() => { | ||
virtualizer.endScrolling(); | ||
setScrolling(false); | ||
}, [virtualizer]) | ||
}; | ||
startScrolling, | ||
endScrolling | ||
}), [ | ||
virtualizer, | ||
visibleViews, | ||
setVisibleRect, | ||
contentSize, | ||
isAnimating, | ||
isScrolling, | ||
startScrolling, | ||
endScrolling | ||
]); | ||
|
||
return state; | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1125,7 +1125,7 @@ | |
core-js-pure "^3.0.0" | ||
regenerator-runtime "^0.13.4" | ||
|
||
"@babel/[email protected]", "@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.9", "@babel/runtime@^7.5.0", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.9.2": | ||
"@babel/[email protected]", "@babel/runtime@^7.0.0", "@babel/runtime@^7.10.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.5", "@babel/runtime@^7.17.8", "@babel/runtime@^7.18.9", "@babel/runtime@^7.5.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.2", "@babel/runtime@^7.7.6", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": | ||
version "7.12.5" | ||
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.12.5.tgz#410e7e487441e1b360c29be715d870d9b985882e" | ||
integrity sha512-plcc+hbExy3McchJCEQG3knOsuh3HH+Prx1P6cLIkET/0dLuQDEnrT+s27Axgc9bqfsmNUNHfscgMUdBpC9xfg== | ||
|
@@ -8684,12 +8684,13 @@ dom-converter@^0.2: | |
dependencies: | ||
utila "~0.4" | ||
|
||
dom-helpers@^3.4.0: | ||
version "3.4.0" | ||
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-3.4.0.tgz#e9b369700f959f62ecde5a6babde4bccd9169af8" | ||
integrity sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA== | ||
dom-helpers@^5.0.1: | ||
version "5.2.1" | ||
resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.2.1.tgz#d9400536b2bf8225ad98fe052e029451ac40e902" | ||
integrity sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA== | ||
dependencies: | ||
"@babel/runtime" "^7.1.2" | ||
"@babel/runtime" "^7.8.7" | ||
csstype "^3.0.2" | ||
|
||
dom-serializer@0: | ||
version "0.2.2" | ||
|
@@ -18615,11 +18616,6 @@ react-is@^16.12.0, react-is@^16.13.1, react-is@^16.8.6: | |
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" | ||
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== | ||
|
||
react-lifecycles-compat@^3.0.4: | ||
version "3.0.4" | ||
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" | ||
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== | ||
|
||
react-lowlight@^2.0.0: | ||
version "2.0.0" | ||
resolved "https://registry.yarnpkg.com/react-lowlight/-/react-lowlight-2.0.0.tgz#3c9fa072c6516add8552f9470287e24e13d38eff" | ||
|
@@ -18653,15 +18649,15 @@ react-test-renderer@^16.9.0: | |
react-is "^16.8.6" | ||
scheduler "^0.16.2" | ||
|
||
react-transition-group@^2.2.0: | ||
version "2.9.0" | ||
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-2.9.0.tgz#df9cdb025796211151a436c69a8f3b97b5b07c8d" | ||
integrity sha512-+HzNTCHpeQyl4MJ/bdE0u6XRMe9+XG/+aL4mCxVN4DnPBQ0/5bfHWPDuOZUzYdMj94daZaZdCCc1Dzt9R/xSSg== | ||
react-transition-group@^4.4.5: | ||
version "4.4.5" | ||
resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.5.tgz#e53d4e3f3344da8521489fbef8f2581d42becdd1" | ||
integrity sha512-pZcd1MCJoiKiBR2NRxeCRg13uCXbydPnmB4EOeRrY7480qNWO8IIgQG6zlDkm6uRMsURXPuKq0GWtiM59a5Q6g== | ||
dependencies: | ||
dom-helpers "^3.4.0" | ||
"@babel/runtime" "^7.5.5" | ||
dom-helpers "^5.0.1" | ||
loose-envify "^1.4.0" | ||
prop-types "^15.6.2" | ||
react-lifecycles-compat "^3.0.4" | ||
|
||
react@^18.0.0: | ||
version "18.1.0" | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we wanting to timers so specifically? Verse
jest.runAllTimers()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
each timer causes a state change, all state changes must happen within an act, once the act is done, the state changes are resolved. in this case, the state changes must be resolved separately because they influence what happens to the next timer.
there are still instances where you'd want to potentially advance multiple timers at once, which is what happens in the majority of our tests