README
serlina-react-router
Usage
npm i react-router-dom serlina-react-router --save
class Home extends React.Component {
render () {
return (
<div>
<div>Home</div>
<Switch>
<Route path='/' exact component={Index} />
<Route path="/about" exact component={About} />
<Route path="/posts" exact component={Posts} />
</Switch>
</div>
)
}
}
export default withRouter(Home, {
getUrl({ ctx }) {
return ctx.url
}
})
options
getUrl: (payload) => string
should return current urlbasename
The base URL for all location.
serlina-apollo
Use withexport default withApollo(withRouter(Home, {
getUrl({ ctx }) {
return ctx.url
}
}), client)
License
MIT License