javascript - components not rendering dynamically with react router v4 -




for reason nested routes in react based application using react-router v4 not working.

the dashboard component rendering 3 child components, namely header , footer & content1 . of these components render default on route /dashboard want content1 component change according url, i.e. content2 component should render on url /dashboard/content2 in place of content1 not happening , hitting url throws 404 error. highly appreciated. following code:

index.js

return (   <router>     <div>       <route exact path="/" component={login}/>       <route path="/dashboard" component={dashboard} />     </div>   </router> ); 

dashboard.js

return (     <div>       <header/>       <footer/>       <switch>         <route path="/dashboard/content2" component={content2} />  // hitting route throws 404 error...        <route component={content1} />       </switch>    </div> ); 





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -