[Lighbox perf - 1] Fix memoization of List component, defer re-rendering when opening lightbox (#9759)

* memoize FlatList_INTERNAL

* defer render, put handleScrolledDownChange in non reactive callback

* lintfix useDedupe
This commit is contained in:
Samuel Newman
2026-01-28 17:35:43 +02:00
committed by GitHub
parent ae77320d81
commit 3b2573bc56
3 changed files with 17 additions and 15 deletions
+4 -4
View File
@@ -1,9 +1,9 @@
import React from 'react'
import {useCallback, useRef} from 'react'
export const useDedupe = (timeout = 250) => {
const canDo = React.useRef(true)
export function useDedupe(timeout = 250) {
const canDo = useRef(true)
return React.useCallback(
return useCallback(
(cb: () => unknown) => {
if (canDo.current) {
canDo.current = false