Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
13 lines
400 B
TypeScript
13 lines
400 B
TypeScript
import { useRef } from 'react'
|
|
import { useEvent } from 'client-common/hooks/use-event'
|
|
|
|
// Focus helper from https://stackoverflow.com/a/54159564/1222351
|
|
export function useFocus(): [React.RefObject<HTMLElement>, () => void] {
|
|
const htmlElRef = useRef<HTMLElement>(null)
|
|
const setFocus = useEvent(() => {
|
|
htmlElRef.current && htmlElRef.current.focus()
|
|
})
|
|
|
|
return [htmlElRef, setFocus]
|
|
}
|