ui/ Routable
Utilities for working with routes.
import Routable from '@enact/ui/Routable';
Members
RoutableHigher-Order Component
A higher-order component that provides support for mapping Routes as children of a component
which are selected via path
instead of the usual flat array.
When using Routable
you must specify the navigate
config option.
import Routable from '@enact/ui/Routable';
Configuration
Properties added to wrapped component
Path to the active panel.
May either be a URI-style path (
'/app/home/settings'
) or an array of strings (['app', 'home', 'settings']
).
RouteComponent
Used with ui/Routable.Routable to define the path
segment and the
component
to render.
Route
elements can be nested to build multiple level paths.
In the below example, Panels
would render SettingsPanel
with breadcrumbs to
navigate AppPanel
and HomePanel
.
<Panels path="/app/home/settings" onSelectBreadcrumb={this.handleNavigate}>
<Route path="app" component={AppPanel}>
<Route path="home" component={HomePanel}>
<Route path="settings" component={SettingsPanel} />
</Route>
</Route>
<Route path="admin" component={AdminPanel} />
<Route path="help" component={HelpPanel} />
</Panels>
import {Route} from '@enact/ui/Routable';
Properties
The component to render when the
path
for this Route matches the path of the ui/Routable.Routable container.The name of the path segment.