@hyperapp/router
Version:
Declarative routing for Hyperapp V1 using the History API.
19 lines (16 loc) • 358 B
JavaScript
import { parseRoute } from "./parseRoute"
export function Route(props) {
return function(state, actions) {
var location = state.location
var match = parseRoute(props.path, location.pathname, {
exact: !props.parent
})
return (
match &&
props.render({
match: match,
location: location
})
)
}
}