FocusRelayProvider

Makes a focus relay the focus parent of its children

Available since @roku-sdk/navigation 2.19.0

import { FocusRelayProvider } from "@roku-sdk/navigation/focus-relay";
FocusRelayProvider(props: IFocusRelayProviderProps): JSX.Element

Description

Makes a focus relay the focus parent of its children.

useFocusable and nested FocusBoundary instances inside it register with the relay rather than with the boundary that rendered them, so they follow the relay when it is rebound.

Parameters

NameTypeDescription
propsIFocusRelayProviderPropsThe relay and the subtree it serves.

Example

<FocusRelayProvider relay={relay}>
    <Cell />
</FocusRelayProvider>

Types

IFocusRelayProviderProps

Props for FocusRelayProvider.

NameTypeDescription
children?ElementThe subtree whose focusables and boundaries follow the relay.
relayFocusRelayThe relay that focusables in children register with, from createFocusRelay.

What’s Next

Did this page help you?