Skip to content

Commit

Permalink
Update Route, Link, NavLink contracts (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
turansky authored Aug 10, 2021
1 parent aad053e commit 9cf5582
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,29 +40,29 @@ external interface HashRouterProps : RouterProps {
var hashType: String
}

external interface RouteProps<T : RProps> : RProps {
external interface RouteProps<T : Props> : Props {
var path: Array<out String>
var exact: Boolean
var strict: Boolean
var component: ComponentType<RProps>
var component: ComponentType<*>
var render: (props: RouteResultProps<T>) -> ReactElement?
}

external interface LinkProps : RProps {
external interface LinkProps : PropsWithChildren {
var to: String
var replace: Boolean
var className: String?
}

external interface NavLinkProps<T : RProps> : LinkProps {
external interface NavLinkProps<T : Props> : LinkProps {
var activeClassName: String
var exact: Boolean
var strict: Boolean
var isActive: ((match: Match<T>?, location: Location) -> Boolean)?
var location: Location
}

external interface RouteResultProps<T : RProps> : RProps {
external interface RouteResultProps<T : Props> : Props {
var history: History
var location: Location
var match: Match<T>
Expand All @@ -86,14 +86,14 @@ external interface Location {
var search: String
}

external interface Match<T : RProps> {
external interface Match<T : Props> {
var isExact: Boolean
var url: String
var path: String
var params: T
}

external interface RedirectProps : RProps {
external interface RedirectProps : Props {
var from: String?
var to: String
var push: Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fun RBuilder.switch(

fun RBuilder.route(
vararg path: String,
component: ComponentType<RProps>,
component: ComponentType<*>,
exact: Boolean = false,
strict: Boolean = false,
) {
Expand Down

0 comments on commit 9cf5582

Please sign in to comment.