Some perf things
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
|||||||
cloneElement,
|
cloneElement,
|
||||||
createContext,
|
createContext,
|
||||||
useContext,
|
useContext,
|
||||||
|
useEffect,
|
||||||
useMemo,
|
useMemo,
|
||||||
useRef,
|
useRef,
|
||||||
useState,
|
useState,
|
||||||
@@ -331,8 +332,13 @@ function GalleryImage({
|
|||||||
)
|
)
|
||||||
const dims = computeDims({height, aspectRatio})
|
const dims = computeDims({height, aspectRatio})
|
||||||
|
|
||||||
onWidthChange(index, dims.width)
|
useEffect(() => {
|
||||||
onContainerRef(index, containerRef)
|
onWidthChange(index, dims.width)
|
||||||
|
}, [index, dims.width, onWidthChange])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
onContainerRef(index, containerRef)
|
||||||
|
}, [index, containerRef, onContainerRef])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Animated.View ref={containerRef} collapsable={false}>
|
<Animated.View ref={containerRef} collapsable={false}>
|
||||||
|
|||||||
Reference in New Issue
Block a user