Loading

Quipoin Menu

Learn • Practice • Grow

react / React Router Introduction
mcq
Direction: Choose the correct option

Q1.

What is React Router?
A. A tool for bundling
B. A library for managing navigation and routing in React apps
C. A state management library
D. A built-in React feature for routing
Direction: Choose the correct option

Q2.

Which components are used to define routes in React Router v6?
A. <Switch> and <Route>
B. <Link> and <NavLink>
C. <Route> and <Routes>
D. <Router> and <Route>
Direction: Choose the correct option

Q3.

What does the component do?
A. Redirects to an external URL
B. Updates the URL and forces a full refresh
C. Navigates to a different route without a page reload
D. Renders a hyperlink that reloads the page
Direction: Choose the correct option

Q4.

How do you access route parameters in a component?
A. Using useLocation
B. Using useRouteMatch
C. Using useParams hook
D. Using props.match.params
Direction: Choose the correct option

Q5.

Which component is used to render the first matching route?
A. <Route>
B. <Redirect>
C. <Routes> (or <Switch> in v5)
D. <Navigate>