t

router.browser

ReactionRouterDOMComponent

trait ReactionRouterDOMComponent extends RoutingSourceComponent[PathParts, String] with RoutingConfig[PathParts, String]

Routing using this facade's router context provider and targeted for the DOM and browser URLs. You don't need this class, you could just listen to the history changes using a browser's history API or the "history" js package. Use a instance of this component as an ancestor to provide the latest "history" location in a react context then use the Route component, a value dependent type, to perform routing anywhere in the application. The F context is Id so there is no effect wrapping a rule's Action.

You may also want to look at the code behind the [history github](https://github.com/ReactTraining/history) package or [react-router-navigation-prompt](https://github.com/ZacharyRSmith/react-router-navigation-prompt) in order to see how to take an user confirmed action such as saving changes before routing away. If you roll your own, you will need to register an "beforeonload" handler with the window when the user types in a new URL and throw up a dialog. You can also register with the document's history object to indepdently listen to history changes and if the URLs are different, throw up a dialog.

Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ReactionRouterDOMComponent
  2. RoutingConfig
  3. RoutingSourceComponent
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. abstract type Config <: ConfigLike
  2. trait ConfigLike extends ReactionRouterDOMComponent.ConfigLike
  3. type Control = DOMControl
  4. case class DOMControl(config: Config) extends ControlLike with Product with Serializable
  5. type Navigator = (String, Redirect) => Unit
    Definition Classes
    RoutingConfig
  6. type RouterInfo = RouterInfoLike
  7. case class RouterInfoLike(info: Option[PathParts] = None) extends ReactionRouterDOMComponent.RouterInfoLike with Product with Serializable

    Context type.

  8. type Rules = (PathParts) => Action

    If your rule needs a Control for rendering a ReactNode, the Render action takes a Control => ReactNode so essentially you have, for rendering, a Info => Control => ReactNode.

    If your rule needs a Control for rendering a ReactNode, the Render action takes a Control => ReactNode so essentially you have, for rendering, a Info => Control => ReactNode. Note that action does not return an effectful action e.g. Action is not wrapped in a F context.

    Definition Classes
    RoutingConfig
  9. type State = Option[PathParts]
    Definition Classes
    RoutingSourceComponent
  10. sealed trait Action extends Product with Serializable

    Take some action as the result of processing a rule.

    Take some action as the result of processing a rule.

    Definition Classes
    RoutingConfig
  11. trait ControlLike extends AnyRef

    Callback arg used by components that hides router and navigation implementation details.

    Callback arg used by components that hides router and navigation implementation details. Not async! When your action is render, you receive a Control as a parameter that you pass to your child component so they can perform navigation actions, such as render a link element. You can curry the navigate function so that components can be fed a simpler To => Unit callback.

    Definition Classes
    RoutingConfig
  12. case class RedirectTo(to: To, method: Redirect, effect: () => Unit = noop) extends Action with Product with Serializable

    Go to another page with a specific method to get there.

    Go to another page with a specific method to get there.

    Definition Classes
    RoutingConfig
  13. case class Render(run: (Control) => ReactNode, effect: () => Unit = noop) extends Action with Product with Serializable

    Render a node allowing that node to use Controls to create "links".

    Render a node allowing that node to use Controls to create "links". Can render to null!

    Definition Classes
    RoutingConfig
  14. case class rule(run: (Info) => Option[Action]) extends Product with Serializable

    Small rules DSL.

    Small rules DSL. Create a rule that can return an optional action.

    Definition Classes
    RoutingConfig
  15. sealed trait NavAction extends AnyRef
    Attributes
    protected
    Definition Classes
    RoutingSourceComponent
  16. case class NewInfo(info: Info) extends NavAction with Product with Serializable
    Attributes
    protected
    Definition Classes
    RoutingSourceComponent
  17. trait Props extends Object
    Definition Classes
    RoutingSourceComponent
    Annotations
    @JSType()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val Name: String

    Override to change the name.

    Override to change the name.

    Definition Classes
    ReactionRouterDOMComponentRoutingSourceComponent
  5. val RouterContext: ReactContext[RouterInfo]
    Definition Classes
    RoutingSourceComponent
  6. def always(always: => Action): Rules

    Create a rule that ignores the Info inpt.

    Create a rule that ignores the Info inpt. Provides semantic gesture.

    Definition Classes
    RoutingConfig
  7. def apply(children_: ReactNode): ReactNode
    Definition Classes
    RoutingSourceComponent
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  10. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  11. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  12. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  13. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  14. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  15. def makeContextValue(info: Option[PathParts]): RouterInfoLike
  16. def makeControl(config: Config): DOMControl
    Attributes
    protected
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. val noop: () => Unit
    Definition Classes
    RoutingConfig
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  21. def performRoutingAction(routing: RoutingSource[PathParts, String], config: Config, to: String, method: Redirect): Unit

    Override to extend.

    Override to extend.

    Attributes
    protected
    Definition Classes
    ReactionRouterDOMComponentRoutingConfig
  22. def render: (Props) => ReactNode
    Definition Classes
    RoutingSourceComponent
  23. val routing: RoutingSource[PathParts, String]
    Attributes
    protected
    Definition Classes
    ReactionRouterDOMComponentRoutingSourceComponent
  24. def rules(run: (PathParts) => Action): Rules

    Create rules, you don't need to use this.

    Create rules, you don't need to use this. Provides semantic gesture.

    Definition Classes
    RoutingConfig
  25. def shouldRoute(p: PathParts, to: String): Boolean
    Attributes
    protected
  26. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  27. def toString(): String
    Definition Classes
    AnyRef → Any
  28. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  29. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  30. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  31. object Route

    A component that uses the context provider and a Config to route.

    A component that uses the context provider and a Config to route.

    To do

    Schedule effect to be run after rule action using a reducerComponent.

  32. object ShowIfMatch

    If the predicate is true, show the child component and optionally alter the context the child sees to reflect the match e.g.

    If the predicate is true, show the child component and optionally alter the context the child sees to reflect the match e.g. strip off the front segment of the URL.

    Definition Classes
    RoutingSourceComponent
  33. case object Subscribe extends NavAction with Product with Serializable
    Attributes
    protected
    Definition Classes
    RoutingSourceComponent

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from RoutingConfig[PathParts, String]

Inherited from RoutingSourceComponent[PathParts, String]

Inherited from AnyRef

Inherited from Any

Ungrouped