Skip to content

Commit 39a7581

Browse files
committed
comment
1 parent 524cac7 commit 39a7581

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/components/PlaceholderItem.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ function PlaceholderItem<T>({ renderPlaceholder }: Props<T>) {
4848
onChange(
4949
activeCellSize,
5050
call([activeCellSize], ([size]) => {
51+
// Using animated values to set height caused a bug where item wouldn't correctly update
52+
// so instead we mirror the animated value in component state.
5153
setPlaceholderSize(size);
5254
})
5355
),
@@ -74,7 +76,7 @@ function PlaceholderItem<T>({ renderPlaceholder }: Props<T>) {
7476

7577
const animStyle = {
7678
opacity,
77-
[sizeKey]: placeholderSize, // Using animated values to set height caused a bug where item wouldn't correctly update
79+
[sizeKey]: placeholderSize,
7880
transform: ([
7981
{ [translateKey]: sub(placeholderOffset, scrollOffset) },
8082
] as unknown) as Animated.AnimatedTransform,

0 commit comments

Comments
 (0)