found icon indicating copy to clipboard operation
found copied to clipboard

router config giving error in rendering component

Open gorfadvijay opened this issue 4 years ago • 1 comments

it giving error

Warning: Functions are not valid as a React child. This may happen if you return a Component instead of from render. Or maybe you meant to call this function rather than return it.

`export default makeRouteConfig(

<Route
    history={history}
    path={HOME}
    Component={App}
    query={AppQuery}
    render={({ resolving, props }) => {
        return props ? <App {...props} /> : <h1>Loading....</h1>
    }}
>
    <Route
        history={history}
        path={DASHBOARD}
        getComponent={() =>
            import('../components/Dashboard/Dashboard').then(
                module => module.default
            )
        }
        render={({ props, Component }) => {
            if (false) {
                throw new RedirectException(DEFAULT_REDIRECT_AFTER_AUTH)
            } else {
                return props ? (
                    <Component {...props} />
                ) : (
                    <h1>Loading....</h1>
                )
            }
        }}
    />
</Route>

)"

gorfadvijay avatar Apr 28 '20 11:04 gorfadvijay

That code looks fine to me. Where specifically is that exception coming from?

taion avatar Apr 28 '20 15:04 taion