react-router-tutorial icon indicating copy to clipboard operation
react-router-tutorial copied to clipboard

Nest Routes Not Working For Me

Open chobo2 opened this issue 8 years ago • 1 comments

I have these scenarios

Settings Page -> Results Page -> Details Page

User chooses settings, clicks next, gets results and then clicks into more details.

Details Page -> Results Page

User goes back to Results page from Details Page. This causes a full re-render, causing me to hit the server again for no point(I have the results stored in an array).

Details Page -> Results Page -> Settings Page -> Results Page

The user goes to details, then back to results(want to grab stored results), then goes back to settings page, makes changes and then goes back to results page(now I want a full grab from server again).

I am wondering if there is away in react router to determine if I came to the page via the browser history or if I was going in a forward motion.

I tried

<Route path="results"component={Results}> <Route path="/results/:id"component={Details} /> </Route>

<Route path="results"component={Results}> <Route path=:id"component={Details} /> </Route>

both just change url but nothing else

chobo2 avatar Jan 26 '17 00:01 chobo2

How did you resolve this. I am facing the same issue!

PratyuSingaraju avatar Jul 28 '17 16:07 PratyuSingaraju