acdlite / acdlite/redux-router
Failed to do dynamic loading with redux-router
- Dominant language
- JavaScript
- Stars
- 2.3k
- Forks
- 194
- PR merge metrics
- No merged PRs in 30d
Description
## Version
2.1.2
## Steps to reproduce
Create a router like below:
```javascript
const rootRouter = {
childRoutes:[{
path:'/root',
component:MainEntry,
childRoutes: [
require('../containers/main_entry')
]
}]
}
return
{rootRouter}
```
but when loading the page, I got below error:
Objects are not valid as a React child (found: object with keys {childRoutes}). If you meant to render a collection of children, use an array instead or wrap the object using createFragment(object) from the React add-ons.
## Expected Behavior
## Actual Behavior
Contributor guide
No contributing guide indexed for this repository
Research direction
Look at the examples in the repository to understand how redux-router expects routes to be structured. The error suggests a route object is being passed incorrectly as a React child. Check the Router and ReduxRouter components in the source code to see how childRoutes should be handled. Verify the dynamic loading pattern by examining similar issues or the test suite.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, react, redux
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100