{"id":663,"date":"2025-05-18T19:14:50","date_gmt":"2025-05-18T19:14:50","guid":{"rendered":"https:\/\/buhave.com\/courses\/?p=663"},"modified":"2025-05-20T12:57:52","modified_gmt":"2025-05-20T12:57:52","slug":"react-router","status":"publish","type":"post","link":"https:\/\/buhave.com\/courses\/react\/react-router\/","title":{"rendered":"React Router"},"content":{"rendered":"<h2>Installing and configuring React Router<\/h2>\n<p>React Router is a popular library for managing navigation and routing in React applications. It enables developers to create single-page applications (SPAs) with multiple views and URL-based navigation.<\/p>\n<h3>Installing React Router<\/h3>\n<p>To start using React Router, you need to install it via npm or yarn. The core package for web applications is <code>react-router-dom<\/code>, which provides routing components specifically for browser environments.<\/p>\n<p><strong>Basic Installation Command<\/strong><\/p>\n<p>Use the following command to install React Router:<\/p>\n<ul>\n<li>npm install react-router-dom<\/li>\n<li>or yarn add react-router-dom<\/li>\n<\/ul>\n<h3>Configuring React Router<\/h3>\n<p>After installation, you configure routing by wrapping your application in a Router component, typically <code>BrowserRouter<\/code>. Inside this, you define <code>Routes<\/code> and <code>Route<\/code> components to map URLs to specific React components.<\/p>\n<p><strong>Key Components<\/strong><\/p>\n<ul>\n<li><code>BrowserRouter<\/code>: Provides the routing context and listens to URL changes<\/li>\n<li><code>Routes<\/code>: Container for all route definitions<\/li>\n<li><code>Route<\/code>: Defines a mapping between a URL path and a component<\/li>\n<li><code>Link<\/code> and <code>NavLink<\/code>: Used to create navigational links without page reloads<\/li>\n<\/ul>\n<p><strong>Setting Up Routes<\/strong><\/p>\n<p>You define routes by specifying the path and the component to render when the URL matches. React Router handles matching the current URL to the right route and rendering the associated component.<\/p>\n<p><strong>Additional Configuration<\/strong><\/p>\n<ul>\n<li>Nested routes for hierarchical UI structures<\/li>\n<li>Route parameters for dynamic URLs<\/li>\n<li>Redirects and navigation guards for protected routes<\/li>\n<\/ul>\n<p><strong>Best Practices<\/strong><\/p>\n<ul>\n<li>Keep routing logic centralized and organized<\/li>\n<li>Use <code>NavLink<\/code> for active link styling<\/li>\n<li>Leverage nested routes to avoid redundant code<\/li>\n<li>Handle 404 and fallback routes gracefully<\/li>\n<\/ul>\n<p>Installing and configuring React Router properly allows you to build responsive, multi-view React applications with smooth navigation and user-friendly URLs.<\/p>\n<h2>Defining routes and Navigation<\/h2>\n<p>Defining routes and navigation in React Router allows you to control which components are rendered based on the current URL, enabling seamless transitions between different parts of a React application.<\/p>\n<h3>Defining Routes<\/h3>\n<p>Routes are defined using the <code>Routes<\/code> and <code>Route<\/code> components from React Router. Each <code>Route<\/code> specifies a <code>path<\/code> and the <code>element<\/code> (React component) to render when the URL matches that path.<\/p>\n<p><strong>Basic Route Setup<\/strong><\/p>\n<p>Wrap your application or the relevant section in <code>BrowserRouter<\/code> and define individual routes within <code>Routes<\/code>. Each route maps a specific URL to a React component.<\/p>\n<p><strong>Nested Routes<\/strong><\/p>\n<p>Nested routes allow you to build hierarchical layouts, where a parent route renders common layout elements and child routes handle more specific content. This improves structure and code reuse in complex apps.<\/p>\n<p><strong>Dynamic Routes<\/strong><\/p>\n<p>You can define dynamic segments in route paths using a colon (e.g., <code>:id<\/code>). These allow your routes to match dynamic values like user IDs or post slugs, which you can access using route parameters.<\/p>\n<h3>Navigation with Link and NavLink<\/h3>\n<p>React Router provides <code>Link<\/code> and <code>NavLink<\/code> components for navigation. These replace traditional anchor tags and enable navigation without reloading the page. <code>NavLink<\/code> also allows styling the active link.<\/p>\n<p><strong>Programmatic Navigation<\/strong><\/p>\n<p>You can navigate programmatically using the <code>useNavigate<\/code> hook, which provides a function to change routes based on events like form submission or button clicks.<\/p>\n<p><strong>Route Matching and Order<\/strong><\/p>\n<p>Routes are matched in the order they appear, and React Router chooses the best match. The routing system supports exact matching and wildcards for flexibility in complex scenarios.<\/p>\n<p><strong>Best Practices<\/strong><\/p>\n<ul>\n<li>Use meaningful and consistent URL paths<\/li>\n<li>Keep route definitions centralized and organized<\/li>\n<li>Leverage nested routes for shared layouts<\/li>\n<li>Use dynamic routes to build reusable route templates<\/li>\n<li>Implement fallback routes for 404 handling<\/li>\n<\/ul>\n<p>Defining routes and navigation properly ensures a smooth user experience and maintainable structure in React applications using React Router.<\/p>\n<h2>Dynamic routes and Nested routing<\/h2>\n<p>Dynamic routes and nested routing are advanced features in React Router that help build flexible and scalable applications with dynamic content and structured layouts.<\/p>\n<h3>What Are Dynamic Routes<\/h3>\n<p>Dynamic routes allow you to define route paths that include variable segments. These segments can represent parameters like user IDs, product names, or article slugs. You define them using a colon followed by a name (e.g., <code>:id<\/code>).<\/p>\n<p><strong>Using Route Parameters<\/strong><\/p>\n<p>When a user navigates to a dynamic URL, the route parameter can be accessed within the component using the <code>useParams<\/code> hook. This lets you fetch or display data based on the current route value.<\/p>\n<p><strong>Example Use Cases<\/strong><\/p>\n<ul>\n<li>User profile pages using <code>\/users\/:userId<\/code><\/li>\n<li>Product details with <code>\/products\/:productId<\/code><\/li>\n<li>Blog post pages using <code>\/posts\/:slug<\/code><\/li>\n<\/ul>\n<h3>What Is Nested Routing<\/h3>\n<p>Nested routing enables you to define routes inside other routes. This is useful for building UIs where a parent layout is shared across multiple child views. Each nested route renders inside an <code>&lt;Outlet&gt;<\/code> component defined in the parent.<\/p>\n<p><strong>Using Outlet for Nested Views<\/strong><\/p>\n<p>The <code>Outlet<\/code> component serves as a placeholder where child routes will be rendered. This allows components to share layout features like navigation bars or side panels, while displaying route-specific content.<\/p>\n<p><strong>Advantages of Nested Routes<\/strong><\/p>\n<ul>\n<li>Improves code structure and reusability<\/li>\n<li>Makes layouts more modular and easier to manage<\/li>\n<li>Allows complex UIs with shared context and navigation<\/li>\n<\/ul>\n<p><strong>Combining Dynamic and Nested Routes<\/strong><\/p>\n<p>You can nest dynamic routes to create detailed hierarchical views. For example, a route like <code>\/users\/:userId\/posts\/:postId<\/code> can display a user profile and a specific post within a shared layout.<\/p>\n<p><strong>Best Practices<\/strong><\/p>\n<ul>\n<li>Use dynamic segments for routes that represent unique data<\/li>\n<li>Use nested routes for sections that share layout or context<\/li>\n<li>Always place an <code>Outlet<\/code> in parent components to enable nesting<\/li>\n<li>Group route definitions logically for better maintainability<\/li>\n<\/ul>\n<p>Dynamic routes and nested routing together allow you to build powerful, maintainable React applications with clear URL structures and reusable layouts.<\/p>\n<h2>Redirects and 404 handling<\/h2>\n<p>Redirects and 404 handling in React Router are essential for guiding users to the correct routes and managing navigation errors when paths do not match any defined route.<\/p>\n<h3>Implementing Redirects<\/h3>\n<p>Redirects are used to automatically navigate users from one path to another. This is useful for route renaming, legacy support, or conditional navigation. React Router provides the <code>Navigate<\/code> component for declarative redirects.<\/p>\n<p><strong>Common Redirect Use Cases<\/strong><\/p>\n<ul>\n<li>Redirecting from old URLs to updated paths<\/li>\n<li>Redirecting users after form submissions or login<\/li>\n<li>Protecting routes by redirecting unauthenticated users<\/li>\n<\/ul>\n<p><strong>Using Navigate for Redirects<\/strong><\/p>\n<p>The <code>Navigate<\/code> component takes a <code>to<\/code> prop for the destination path and replaces the current location in the browser history. It can be rendered conditionally to control access or behavior based on app logic.<\/p>\n<p><strong>Programmatic Redirection<\/strong><\/p>\n<p>With the <code>useNavigate<\/code> hook, you can trigger redirects in event handlers or lifecycle logic. This is useful for redirecting users after actions like saving data or logging in.<\/p>\n<p><strong>Handling 404 Pages<\/strong><\/p>\n<p>To handle unmatched routes (404 errors), define a fallback <code>Route<\/code> with a path of <code>*<\/code>. This will catch all undefined routes and display a custom error message or page.<\/p>\n<p><strong>Example 404 Handling Scenario<\/strong><\/p>\n<ul>\n<li>Define a route with <code>path=\"*\"<\/code> at the end of your route list<\/li>\n<li>Render a custom 404 component with helpful messaging or navigation<\/li>\n<\/ul>\n<p><strong>Best Practices<\/strong><\/p>\n<ul>\n<li>Use redirects to maintain smooth navigation and user experience<\/li>\n<li>Use route guards with redirects for access control<\/li>\n<li>Ensure all apps have a clear and helpful 404 page<\/li>\n<li>Avoid unnecessary redirects to reduce navigation complexity<\/li>\n<\/ul>\n<p>Using redirects and 404 handling effectively improves user flow, maintains clean navigation, and ensures users don\u2019t get lost in your application\u2019s routing system.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installing and configuring React Router React Router is a popular library for managing navigation and routing in React applications. It enables developers to create single-page applications (SPAs) with multiple views and URL-based navigation. Installing React Router To start using React Router, you need to install<\/p>\n","protected":false},"author":1,"featured_media":748,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-663","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-react"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>React Router - React Course<\/title>\n<meta name=\"description\" content=\"React Router enables dynamic routing in React applications, allowing navigation between views without full page reloads.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/buhave.com\/courses\/react\/react-router\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"React Router - React Course\" \/>\n<meta property=\"og:description\" content=\"React Router enables dynamic routing in React applications, allowing navigation between views without full page reloads.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/buhave.com\/courses\/react\/react-router\/\" \/>\n<meta property=\"og:site_name\" content=\"BUHAVE\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/BeYouHave\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/naveedsafdarawan\/\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-18T19:14:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-20T12:57:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/React-Router.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Naveed Safdar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Naveed Safdar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/\"},\"author\":{\"name\":\"Naveed Safdar\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/person\\\/04fe0254e118521c9fbb3da39de5acca\"},\"headline\":\"React Router\",\"datePublished\":\"2025-05-18T19:14:50+00:00\",\"dateModified\":\"2025-05-20T12:57:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/\"},\"wordCount\":1119,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/React-Router.webp\",\"articleSection\":[\"React Course\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/\",\"name\":\"React Router - React Course\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/React-Router.webp\",\"datePublished\":\"2025-05-18T19:14:50+00:00\",\"dateModified\":\"2025-05-20T12:57:52+00:00\",\"description\":\"React Router enables dynamic routing in React applications, allowing navigation between views without full page reloads.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/#primaryimage\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/React-Router.webp\",\"contentUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/React-Router.webp\",\"width\":1200,\"height\":628,\"caption\":\"React Router\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/react\\\/react-router\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Courses\",\"item\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"React Course\",\"item\":\"https:\\\/\\\/buhave.com\\\/courses\\\/learn\\\/react\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"React Router\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#website\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\",\"name\":\"BUHAVE\",\"description\":\"Courses - Learn Online for Free\",\"publisher\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/buhave.com\\\/courses\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#organization\",\"name\":\"BUHAVE\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/buhave-course.webp\",\"contentUrl\":\"https:\\\/\\\/buhave.com\\\/courses\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/buhave-course.webp\",\"width\":375,\"height\":75,\"caption\":\"BUHAVE\"},\"image\":{\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/BeYouHave\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/buhave\",\"https:\\\/\\\/www.youtube.com\\\/@buhave\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/buhave.com\\\/courses\\\/#\\\/schema\\\/person\\\/04fe0254e118521c9fbb3da39de5acca\",\"name\":\"Naveed Safdar\",\"description\":\"I\u2019m Naveed Safdar - SEO Manager with over 10 years of experience in SEO and Digital Marketing. I\u2019ve had the privilege of working with leading national and international companies including Grafdom, PakWheels, Systems Limited, Confiz, Educative, and Dubizzle Labs. My expertise spans technical SEO, content strategy, organic growth, and performance analytics - helping businesses improve visibility, traffic, and ROI.\",\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/in\\\/naveedsafdar\\\/\",\"https:\\\/\\\/www.facebook.com\\\/naveedsafdarawan\\\/\",\"https:\\\/\\\/www.youtube.com\\\/@naveedsafdar\"],\"url\":\"https:\\\/\\\/buhave.com\\\/courses\\\/author\\\/naveed-safdar\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"React Router - React Course","description":"React Router enables dynamic routing in React applications, allowing navigation between views without full page reloads.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/buhave.com\/courses\/react\/react-router\/","og_locale":"en_US","og_type":"article","og_title":"React Router - React Course","og_description":"React Router enables dynamic routing in React applications, allowing navigation between views without full page reloads.","og_url":"https:\/\/buhave.com\/courses\/react\/react-router\/","og_site_name":"BUHAVE","article_publisher":"https:\/\/www.facebook.com\/BeYouHave\/","article_author":"https:\/\/www.facebook.com\/naveedsafdarawan\/","article_published_time":"2025-05-18T19:14:50+00:00","article_modified_time":"2025-05-20T12:57:52+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/React-Router.webp","type":"image\/webp"}],"author":"Naveed Safdar","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Naveed Safdar","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/buhave.com\/courses\/react\/react-router\/#article","isPartOf":{"@id":"https:\/\/buhave.com\/courses\/react\/react-router\/"},"author":{"name":"Naveed Safdar","@id":"https:\/\/buhave.com\/courses\/#\/schema\/person\/04fe0254e118521c9fbb3da39de5acca"},"headline":"React Router","datePublished":"2025-05-18T19:14:50+00:00","dateModified":"2025-05-20T12:57:52+00:00","mainEntityOfPage":{"@id":"https:\/\/buhave.com\/courses\/react\/react-router\/"},"wordCount":1119,"commentCount":0,"publisher":{"@id":"https:\/\/buhave.com\/courses\/#organization"},"image":{"@id":"https:\/\/buhave.com\/courses\/react\/react-router\/#primaryimage"},"thumbnailUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/React-Router.webp","articleSection":["React Course"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/buhave.com\/courses\/react\/react-router\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/buhave.com\/courses\/react\/react-router\/","url":"https:\/\/buhave.com\/courses\/react\/react-router\/","name":"React Router - React Course","isPartOf":{"@id":"https:\/\/buhave.com\/courses\/#website"},"primaryImageOfPage":{"@id":"https:\/\/buhave.com\/courses\/react\/react-router\/#primaryimage"},"image":{"@id":"https:\/\/buhave.com\/courses\/react\/react-router\/#primaryimage"},"thumbnailUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/React-Router.webp","datePublished":"2025-05-18T19:14:50+00:00","dateModified":"2025-05-20T12:57:52+00:00","description":"React Router enables dynamic routing in React applications, allowing navigation between views without full page reloads.","breadcrumb":{"@id":"https:\/\/buhave.com\/courses\/react\/react-router\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/buhave.com\/courses\/react\/react-router\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buhave.com\/courses\/react\/react-router\/#primaryimage","url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/React-Router.webp","contentUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/05\/React-Router.webp","width":1200,"height":628,"caption":"React Router"},{"@type":"BreadcrumbList","@id":"https:\/\/buhave.com\/courses\/react\/react-router\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Courses","item":"https:\/\/buhave.com\/courses\/"},{"@type":"ListItem","position":2,"name":"React Course","item":"https:\/\/buhave.com\/courses\/learn\/react\/"},{"@type":"ListItem","position":3,"name":"React Router"}]},{"@type":"WebSite","@id":"https:\/\/buhave.com\/courses\/#website","url":"https:\/\/buhave.com\/courses\/","name":"BUHAVE","description":"Courses - Learn Online for Free","publisher":{"@id":"https:\/\/buhave.com\/courses\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/buhave.com\/courses\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/buhave.com\/courses\/#organization","name":"BUHAVE","url":"https:\/\/buhave.com\/courses\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/buhave.com\/courses\/#\/schema\/logo\/image\/","url":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/03\/buhave-course.webp","contentUrl":"https:\/\/buhave.com\/courses\/wp-content\/uploads\/2025\/03\/buhave-course.webp","width":375,"height":75,"caption":"BUHAVE"},"image":{"@id":"https:\/\/buhave.com\/courses\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/BeYouHave\/","https:\/\/www.linkedin.com\/company\/buhave","https:\/\/www.youtube.com\/@buhave"]},{"@type":"Person","@id":"https:\/\/buhave.com\/courses\/#\/schema\/person\/04fe0254e118521c9fbb3da39de5acca","name":"Naveed Safdar","description":"I\u2019m Naveed Safdar - SEO Manager with over 10 years of experience in SEO and Digital Marketing. I\u2019ve had the privilege of working with leading national and international companies including Grafdom, PakWheels, Systems Limited, Confiz, Educative, and Dubizzle Labs. My expertise spans technical SEO, content strategy, organic growth, and performance analytics - helping businesses improve visibility, traffic, and ROI.","sameAs":["https:\/\/www.linkedin.com\/in\/naveedsafdar\/","https:\/\/www.facebook.com\/naveedsafdarawan\/","https:\/\/www.youtube.com\/@naveedsafdar"],"url":"https:\/\/buhave.com\/courses\/author\/naveed-safdar\/"}]}},"_links":{"self":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/663","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/comments?post=663"}],"version-history":[{"count":2,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/663\/revisions"}],"predecessor-version":[{"id":749,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/posts\/663\/revisions\/749"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/media\/748"}],"wp:attachment":[{"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/media?parent=663"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/categories?post=663"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buhave.com\/courses\/wp-json\/wp\/v2\/tags?post=663"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}