erikras / erikras/react-redux-universal-hot-example
SOLVED: Hard time getting dynamic routes to work
- Dominant language
- JavaScript
- Stars
- 12.1k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
I've been on this for over a week with no success. Here is my status so far ...
```
exports.getRoutes =(store) => {
let dynRoutes = [];
store.dispatch(loadNav()).then(result => {
dynRoutes = result;
});
return (
/**
* Please keep routes in alphabetical order
*/
{ /* Home (main) route */ }
{ /* Get Dyanamic routes from database */ }
{ dynRoutes.length > 0 ?
: ''}
{ /* Catch all route */ }
)
}
```
While the callback does occur and dynRoutes does have a value, the return has already completed and the component DynamicRoutes is no longer called with the actual dynRoutes prop values.
Any ideas?
Contributor guide
Assessment
This issue has not been assessed yet.