diff --git a/examples/grid.tsx b/examples/grid.tsx index 89273d12a..42b5655c5 100644 --- a/examples/grid.tsx +++ b/examples/grid.tsx @@ -86,7 +86,9 @@ export function ReadyStateChanged() { <> { + setGridVisible(value) + }} components={{ Item: ItemContainer, List: ListContainer, diff --git a/src/VirtuosoGrid.tsx b/src/VirtuosoGrid.tsx index eb89fc47f..88ee3472b 100644 --- a/src/VirtuosoGrid.tsx +++ b/src/VirtuosoGrid.tsx @@ -36,8 +36,12 @@ const gridComponentPropsSystem = /*#__PURE__*/ u.system(() => { const readyStateChanged = u.statefulStream(false) + const reportReadyState = u.statefulStream(false) + u.connect(u.duc(reportReadyState), readyStateChanged) + return { readyStateChanged, + reportReadyState, context, itemContent, components, @@ -75,7 +79,7 @@ const GridItems: React.FC = /*#__PURE__*/ React.memo(function GridItems() { const gridGap = usePublisher('gap') const log = useEmitterValue('log') const stateRestoreInProgress = useEmitterValue('stateRestoreInProgress') - const reportReadyState = usePublisher('readyStateChanged') + const reportReadyState = usePublisher('reportReadyState') const listRef = useSize( React.useMemo(