object Route
Route, most commonly used router component. Watch out for which apply method you use as rendering with path, children or exact=true does different thnigs. Rendering with a "component" specified as the prop is not supported. Rendering with children means that the child is always rendered regardless of whether there is a match or not.
Type parameter S
stands for
"state" which is state you can add to the history stack per push. P
is a js
object for query parameters, hence, each property should have a string value.
Using the children props always renders regardless of path match. Typically,
use the render prop.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Route
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
- trait Props[S, P] extends Object with RouteProps[S]
- Annotations
- @JSType()
Value Members
- def always[S, P](children: Function1[RouteComponentProps[S, P], ReactNode]): ReactElement
- def always(children: ReactNode): ReactElement
- def apply[S, P](props: Props[S, P])(children: Function1[RouteComponentProps[S, P], ReactNode]): ReactElement
Uses children prop.
- def apply[S, P](props: Props[S, P], child: ReactNode): ReactElement
- def withExactPath(p: |[String, Array[String]], child: ReactNode): ReactElement
With exact = true
- def withExactPathRender[S, P](p: |[String, Array[String]])(thunk: Function1[RouteComponentProps[S, P], ReactNode]): ReactElement
Uses render prop.
- def withPath[S, P](p: |[String, Array[String]])(children: Function1[RouteComponentProps[S, P], ReactNode]): ReactElement
Uses children prop.
- def withPath(p: |[String, Array[String]], child: ReactNode): ReactElement
- def withPathRender[S, P](p: |[String, Array[String]])(thunk: Function1[RouteComponentProps[S, P], ReactNode]): ReactElement
Uses render prop.
- object JS extends Object with ReactJSComponent
- Annotations
- @native() @JSImport("react-router-dom", "Route")