React-router: NotFound Component is not rendering with nested child routes react-router-config

Created on 26 Nov 2017  路  2Comments  路  Source: ReactTraining/react-router

I don't know why not found component is not rendering it always matches the parent component and if user is not logged in it throw him to home page.

import Home from './containers/Home';
import PrivateLayout from './containers/PrivateLayout';
import NewTest from './containers/NewTest'
import TestBoard from './containers/TestBoard';
import Profile from './containers/Profile';
import NotFound from './containers/NotFound';
import PublicLayout from './containers/PublicLayout';



export default [
    {
        ...Home,
        path:'/',
        exact:true
    },
    {
        ...PublicLayout,
        routes:[
            {
                ...Profile,
                path:'/@:username',
                exact:true
            },
            {
                ...PrivateLayout,
                routes:[
                    {
                        ...TestBoard,
                        path:'/home',
                        exact:true

                    },
                    {
                        ...NewTest,
                        path:'/test/:username',
                        exact:true
                    }
                ]
            }
        ]
    },
    {
        ...NotFound
    },


]

All 2 comments

This is a bug tracker, not a support system. For usage questions, please use Stack Overflow or Reactiflux where there are a lot more people ready to help you out. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ackvf picture ackvf  路  3Comments

andrewpillar picture andrewpillar  路  3Comments

jzimmek picture jzimmek  路  3Comments

winkler1 picture winkler1  路  3Comments

ryansobol picture ryansobol  路  3Comments