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

andrewpillar picture andrewpillar  路  3Comments

misterwilliam picture misterwilliam  路  3Comments

alexyaseen picture alexyaseen  路  3Comments

Radivarig picture Radivarig  路  3Comments

maier-stefan picture maier-stefan  路  3Comments