FlashKeepers

Web Development · College · College and University

React III: Routing, State Management and Testing

React Router, Context versus Redux and Zustand, data fetching with React Query, performance optimization and React Testing Library.

About this set

34 basic cards for College Web Development. Set 3 of 3 in React. It opens with "What is React Router used for?" and "What does BrowserRouter do?". Study it alongside the other College sets below.

34 cards · basic cards · AI-written, checked twice. Edit anything.

Study this set free Look inside first Get FlashKeepers for iPhone

Opens in your browser, no account. Get the iPhone and iPad app · Android app

What is React Router used for?
Show answerDeclarative routing library for single-page applications, enabling navigation between components without full page reloads.
What does BrowserRouter do?
Show answerProvides the routing context for a React app by syncing the UI to the URL using the History API.
What is a dynamic route segment?
Show answerA URL path part that captures variable values, like /users/:id where :id is the dynamic part.
How do you get URL parameters in React Router v6?
Show answerUse the useParams hook to access named parameters from the current route.
What replaces the Switch component in React Router v6?
Show answerThe Routes component, which matches the first route that corresponds to the path.
What does useNavigate do?
Show answerReturns a function to programmatically navigate to a different route.
What is nested routing in React Router?
Show answerOrganizing routes as a tree where child routes inherit their parent's URL path.
How does Link differ from an HTML a tag?
Show answerLink navigates without a full page reload and preserves component state; a tag causes a full page reload.
When is Context API preferred over Redux?
Show answerFor simple state that does not need middleware, dev tools, time travel, or complex state logic.
What is the main issue with Context API at scale?
Show answerFrequent re-renders when context value changes, as all consuming components re-render regardless of whether they use only part of the value.
What is the Redux store?
Show answerA single object that holds the entire application state and provides methods to access and update it.
What is a Redux action?
Show answerA plain object with a type property describing what happened, optionally containing additional data.
What is a Redux reducer?
Show answerA pure function that takes the current state and an action, returning the new state.
How does Zustand differ from Redux?
Show answerZustand is simpler and lighter weight with a hooks-based API; Redux is more structured with middleware and dev tools.
What is Redux middleware used for?
Show answerIntercepting actions between dispatch and the reducer to handle async operations, logging, or side effects.

19 more cards in the app

Study this set free