FocusPathContext

Context that RootFocusBoundary provides when its setFocusPath prop is set, so that useFocusable can report which SceneGraph node holds virtual focus

Available since @roku-sdk/navigation 2.18.0

import { FocusPathContext } from "@roku-sdk/navigation";

Also exported as FocusPathCtx from @roku-sdk/navigation (deprecated).

Deprecated: FocusPathCtx. Use FocusPathContext. Removed in the next major release.

const FocusPathContext: Context<IFocusPathContext | undefined>

Description

Context that RootFocusBoundary provides when its setFocusPath prop is set, so that useFocusable can report which SceneGraph node holds virtual focus.

Apps don't normally read or provide this context themselves. Without a provider, focus-path tracking is off.

Types

IFocusPathContext

The value RootFocusBoundary provides through FocusPathContext when its setFocusPath prop is set.

NameTypeDescription
notifyFocus(domNode: DomNode) => voidNotify the provider that this DomNode now holds virtual focus.
rootNode() => DomNode | nullThe root DomNode rendered by the provider's wrapper <group>.

What’s Next

Did this page help you?