MCPcopy
hub / github.com/shadcn-ui/ui / useLatest

Function useLatest

packages/react/src/message-scroller/utils.ts:3–9  ·  view source on GitHub ↗
(value: T)

Source from the content-addressed store, hash-verified

1import * as React from "react"
2
3function useLatest<T>(value: T) {
4 const ref = React.useRef(value)
5
6 ref.current = value
7
8 return ref
9}
10
11export { useLatest }

Callers 1

MessageScrollerButtonFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected