Skip to Main Content
React Projects
book

React Projects

by Roy Derks
December 2019
Intermediate to advanced content levelIntermediate to advanced
474 pages
10h 3m
English
Packt Publishing
Content preview from React Projects

Handling query strings

Being able to navigate to individual questions is only one piece of the cake when you want to add routing a project, and pagination could be another one. For this, it would be a good idea to move the overview of all of the questions to another route that is called /questions. To do this, you need to add another Route that refers to the Feed component within Router in your App component:

...class App extends Component {  render() {    return (       <>         <GlobalStyle />         <AppWrapper>           <Header />           <Router>             <Route exact path='/' component={Feed} />+            <Route path='/questions' component={Feed} />             <Route path='/questions/:id' component={Question} />           </Router>          </AppWrapper>        </>     );   } } export default App;

However, if you now visit the project ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

React Projects - Second Edition

React Projects - Second Edition

Roy Derks
Test-Driven React

Test-Driven React

Trevor Burnham

Publisher Resources

ISBN: 9781789954937Supplemental Content