mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-22 13:21:37 +01:00
Transition: Fix moving cached virtual elements within tree
This commit is contained in:
parent
eb0e304ff8
commit
9fb3b71e58
@ -11,8 +11,8 @@
|
||||
"deploy:production": "npm run build:production && git add -A && git commit -a -m '[Build]' --no-verify && git push",
|
||||
"print_version": "node -p -e \"require('./package.json').version\"",
|
||||
"inc_version": "echo $((`cat .patch-version` + 1)) > .patch-version && echo \"$(node -p -e \"require('./package.json').version.match(/^\\d+\\.\\d+/)[0]\").$(cat .patch-version)\"",
|
||||
"lint": "tsc && stylelint \"**/*.{css,scss}\" && eslint . --ext .ts,.tsx --ignore-pattern src/lib/gramjs",
|
||||
"lint:fix": "stylelint . && npm run lint -- --fix",
|
||||
"check": "tsc && stylelint \"**/*.{css,scss}\" && eslint . --ext .ts,.tsx --ignore-pattern src/lib/gramjs",
|
||||
"check:fix": "npm run check -- --fix",
|
||||
"gramjs:tl": "node ./src/lib/gramjs/tl/generateModules.js",
|
||||
"gramjs:lint:fix": "eslint ./src/lib/gramjs --fix",
|
||||
"test": "cross-env APP_ENV=test jest --verbose --forceExit",
|
||||
|
@ -248,9 +248,8 @@ const Transition: FC<TransitionProps> = ({
|
||||
}, [shouldRestoreHeight, children]);
|
||||
|
||||
const renders = rendersRef.current;
|
||||
const collection = Object.keys(renderCount ? new Array(renderCount).fill(undefined) : renders).map(Number);
|
||||
|
||||
const contents = collection.map((key) => {
|
||||
const renderKeys = Object.keys(renderCount ? new Array(renderCount).fill(undefined) : renders).map(Number);
|
||||
const contents = renderKeys.map((key) => {
|
||||
const render = renders[key];
|
||||
if (!render) {
|
||||
return undefined;
|
||||
@ -270,7 +269,7 @@ const Transition: FC<TransitionProps> = ({
|
||||
ref={containerRef}
|
||||
id={id}
|
||||
className={buildClassName('Transition', className, name)}
|
||||
teactFastList={!renderCount && !shouldCleanup}
|
||||
teactFastList={!renderCount}
|
||||
>
|
||||
{contents}
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user