MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / useScrollToBottom

Function useScrollToBottom

apps/cli/src/ui/components/ScrollArea.tsx:385–398  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

383 * Hook to use with ScrollArea for external control
384 */
385export function useScrollToBottom() {
386 const triggerRef = useRef(0)
387 const [, forceUpdate] = useReducer((x) => x + 1, 0)
388
389 const scrollToBottom = useCallback(() => {
390 triggerRef.current += 1
391 forceUpdate()
392 }, [])
393
394 return {
395 scrollToBottomTrigger: triggerRef.current,
396 scrollToBottom,
397 }
398}

Callers 1

AppInnerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected