0
0
Reactframework~5 mins

React Router overview - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is React Router used for in a React application?
React Router helps manage navigation between different pages or views in a React app without reloading the whole page. It makes the app feel faster and smoother.
Click to reveal answer
beginner
What component do you use to define routes in React Router?
You use the <Route> component inside a <Routes> container to define which component shows for a specific URL path.
Click to reveal answer
intermediate
How does React Router keep the UI in sync with the URL?
React Router listens to URL changes and renders the matching components automatically, so the UI always matches the current URL.
Click to reveal answer
beginner
What is the purpose of the <Link> component in React Router?
The <Link> component creates clickable links that change the URL and show new content without reloading the page, unlike a regular HTML <a> tag.
Click to reveal answer
intermediate
What is a nested route in React Router?
A nested route is a route defined inside another route, allowing you to build layouts where parts of the page change while other parts stay the same.
Click to reveal answer
Which React Router component wraps all your routes?
A<Routes>
B<Router>
C<Route>
D<Link>
What does the <Link> component do differently than a normal <a> tag?
APrevents navigation
BReloads the page
CChanges URL without page reload
DOnly works with external links
How do you define a route that shows a component at path '/home'?
A<Routes path='/home' component={Home} />
B<Route path='/home' element={<Home />} />
C<Link to='/home' component={Home} />
D<Route component='/home' element={Home} />
What happens when the URL changes in a React Router app?
AReact Router renders matching components
BNothing changes
CThe page reloads
DThe browser crashes
What is a benefit of nested routes?
AThey make the app slower
BThey only work with external URLs
CThey prevent navigation
DThey allow parts of the page to stay while others change
Explain how React Router helps build single-page applications.
Think about how websites feel faster when they don't reload the whole page.
You got /3 concepts.
    Describe the roles of , , and components in React Router.
    Consider how these components work together to handle navigation.
    You got /3 concepts.