Open cparker15 opened 8 years ago
Thanks for reporting this issue. I'm going to look into it. I think the issue here is that the type
property of the route is missing, and that is what we are looking at when we are mapping up the routes (see https://github.com/stormpath/stormpath-sdk-react/blob/master/src/components/Router.js#L59). In theory it should work if you add the property type
and in that, specify the React-Stormpath router types (HomeRoute
, AuthenticatedRoute
and LoginRoute
).
Thank you for your quick response! Unfortunately, adding the HomeRoute
did not solve the issue.
However, I threw a try
/catch
around render()
and caught this, which seems like it may be helpful.
Error: Objects are not valid as a React child (found: object with keys {type, path, component, indexRoute, getChildRoutes}). 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. Check the render method of
Router
.
It seems that the routes
prop is expected to be a JSX component exclusively, and it doesn't seem as though the childRoutes
prop for PlainRoute
objects is implemented. React Router's Router
implementation supports passing PlainRoute
s to both. https://github.com/reactjs/react-router/blob/master/docs/API.md#plainroute
Will this SDK only support JSX routes? I'm trying to use async route definitions like this (from @davezuko's
react-redux-starter-kit
) with no success:definition:
usage: