mirror of
https://github.com/danog/telegram-tt.git
synced 2025-01-23 05:41:14 +01:00
UI Loader: Fix flickering with resized Left Column (#2030)
This commit is contained in:
parent
2a6debb587
commit
45dee440a7
@ -1,5 +1,5 @@
|
|||||||
import type { RefObject } from 'react';
|
import type { RefObject } from 'react';
|
||||||
import { useState, useEffect } from '../lib/teact/teact';
|
import { useState, useEffect, useLayoutEffect } from '../lib/teact/teact';
|
||||||
import useFlag from './useFlag';
|
import useFlag from './useFlag';
|
||||||
|
|
||||||
export function useResize(
|
export function useResize(
|
||||||
@ -12,7 +12,7 @@ export function useResize(
|
|||||||
const [initialMouseX, setInitialMouseX] = useState<number>();
|
const [initialMouseX, setInitialMouseX] = useState<number>();
|
||||||
const [initialElementWidth, setInitialElementWidth] = useState<number>();
|
const [initialElementWidth, setInitialElementWidth] = useState<number>();
|
||||||
|
|
||||||
useEffect(() => {
|
useLayoutEffect(() => {
|
||||||
if (!elementRef.current || !initialWidth) {
|
if (!elementRef.current || !initialWidth) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user