如何使用fluxible-router访问动态navParams
例如,如果我有一个用户组件,并且我想根据路由设置组件的 userId 属性
// configs/routes.js
module.exports = {
home: {
method: 'GET',
path: '/',
handler: require('../components/Home.jsx'),
// Executed on route match
action: require('../actions/loadHome')
},
user: {
method: 'GET',
path: '/user/:id',
handler: require('../components/User.jsx')
}
};
https://github.com/yahoo/fluxible-router/blob/master/docs/quick-start.md
如何在 User.jsx 组件中访问该 userId?