components | @uirouter/react
Options
Menu

Module components

Components

UI-Router React Components and their APIs:

  • UIRouter: Main router component
  • UIView: A viewport for routed components
  • UISref: A state ref to a target state; navigates when clicked
  • UISrefActive: Adds a css class when a UISref's target state (or a child state) is active

Index

Type aliases

RenderPropCallback: function

Function type for UIViewProps.render

Function type for UIViewProps.render

If the render function prop is provided, the UIView will use it instead of rendering the component by itself.

Type declaration

    • (Component: StatelessComponent<any> | ComponentClass<any> | ClassicComponentClass<any>, Props: any): Element | null
    • Parameters

      • Component StatelessComponent<any> | ComponentClass<any> | ClassicComponentClass<any>
      • Props any

      Returns Element | null

Variables

StateNameMustBeAStringError: Error = new Error('State name provided to <UISref {to}> must be a string.')
TransitionPropCollisionError: Error = new Error('`transition` cannot be used as resolve token. ' +'Please rename your resolve to avoid conflicts with the router transition.',)
UIRouterConsumer: ComponentClass<ConsumerProps<UIRouterReact>> | StatelessComponent<ConsumerProps<UIRouterReact>>

component lets you access the UIRouter instance anywhere in the component tree, by simply wrapping your component and using the function-as-child pattern to pass the instance via props.

component lets you access the UIRouter instance anywhere in the component tree, by simply wrapping your component and using the function-as-child pattern to pass the instance via props.

Example:

<UIRouterConsumer>
 {router => <MyComponent router={router} />}
</UIRouterConsumer>
UIRouterProvider: ComponentClass<ProviderProps<UIRouterReact>> | StatelessComponent<ProviderProps<UIRouterReact>>
UISrefActiveConsumer: ComponentClass<ConsumerProps<Function>> | StatelessComponent<ConsumerProps<Function>>
UISrefActiveProvider: ComponentClass<ProviderProps<Function>> | StatelessComponent<ProviderProps<Function>>
UIViewConsumer: ComponentClass<ConsumerProps<UIViewAddress>> | StatelessComponent<ConsumerProps<UIViewAddress>>
UIViewProvider: ComponentClass<ProviderProps<UIViewAddress>> | StatelessComponent<ProviderProps<UIViewAddress>>
classNames: function = _classNames

Type declaration

    • (...classes: ClassValue[]): string
    • Parameters

      • ...classes: Rest  ClassValue[]

      Returns string

classNames: function = _classNames

Type declaration

    • (...classes: ClassValue[]): string
    • Parameters

      • ...classes: Rest  ClassValue[]

      Returns string

id: number = 0

Functions

  • UISref(props: any): Element
  • UISrefActive(props: any): Element
  • UIView(props: any): Element

Generated using TypeDoc