MCPcopy Index your code
hub / github.com/TanStack/router / Block

Function Block

packages/solid-router/src/useBlocker.tsx:305–317  ·  view source on GitHub ↗
(opts: PromptProps | LegacyPromptProps)

Source from the content-addressed store, hash-verified

303export function Block(opts: LegacyPromptProps): SolidNode
304
305export function Block(opts: PromptProps | LegacyPromptProps): SolidNode {
306 const [propsWithChildren, rest] = Solid.splitProps(opts, ['children'])
307 const args = _resolvePromptBlockerArgs(rest)
308
309 const resolver = useBlocker(args)
310 const children = Solid.createMemo(() => {
311 const child = propsWithChildren.children
312 if (resolver && typeof child === 'function') return child(resolver())
313 return child
314 })
315
316 return <>{children()}</>
317}
318
319type LegacyPromptProps = {
320 blockerFn?: LegacyBlockerFn

Callers

nothing calls this directly

Calls 2

useBlockerFunction · 0.70

Tested by

no test coverage detected