Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

router config giving error in rendering component #689

Open
gorfadvijay opened this issue Apr 28, 2020 · 1 comment
Open

router config giving error in rendering component #689

gorfadvijay opened this issue Apr 28, 2020 · 1 comment

Comments

@gorfadvijay
Copy link

gorfadvijay commented Apr 28, 2020

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>

)"

@taion
Copy link
Contributor

taion commented Apr 28, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants