Awesome
For now we deprecate this HOC (and our redux-little-router usage) in profit of k-redux-router.
Please open an issue if you want to argue about this decision.
Feel free to open PRs, we are still reviewing them
hoc-little-router
redux-little-router HOC to render a component when the route is matching!
You need redux-little-router for that HOC.
Examples
routes (redux-little-router ones)
export default {
'/': {
title: 'HOME',
'/search': {
title: 'SEARCH',
},
},
}
Relative
The Home
component will be printed when redux-little-router
find a title that match HOME
from URL and its parents.
// ...
import router from 'hoc-little-router'
class Home extends React.Component {
// ...
export default router('HOME')(Home)
/
: Home Component is printed/search
: Home Component is printed
List screens
You can attach the same component to multiple routes like this:
import router from 'hoc-little-router'
class Menu extends React.Component {
// ...
export default router(['HOME', 'SEARCH'])(Menu)
Absolute
The Home
component will be printed when redux-little-router
find a title that match HOME
from URL but not its parents.
// ...
import router from 'hoc-little-router'
class Home extends React.Component {
// ...
export default router('HOME', { absolute: true })(Home)
// or
export default router.absolute('HOME')(Home)
/
: Home Component is printed/search
: Home Component is not printed
About uni rakun
uni rakun is created by two passionate french developers.
Do you want to contact them ? Go to their website
<table border="0"> <tr> <td align="center"><img src="https://avatars1.githubusercontent.com/u/26094222?s=460&v=4" width="100" /></td> <td align="center"><img src="https://avatars1.githubusercontent.com/u/17828231?s=460&v=4" width="100" /></td> </tr> <tr> <td align="center"><a href="https://github.com/guillaumecrespel">Guillaume CRESPEL</a></td> <td align="center"><a href="https://github.com/fabienjuif">Fabien JUIF</a></td> </table>