{"id":74,"date":"2025-01-22T04:42:43","date_gmt":"2025-01-22T04:42:43","guid":{"rendered":"https:\/\/techkubo.com\/react\/?p=74"},"modified":"2025-05-19T09:41:40","modified_gmt":"2025-05-19T09:41:40","slug":"react-router","status":"publish","type":"post","link":"https:\/\/techkubo.com\/react\/react-router\/","title":{"rendered":"React Router"},"content":{"rendered":"\n<p>While Create React App doesn&#8217;t include page routing out-of-the-box, React Router is the most popular solution for handling routing in React applications.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Adding React Router to Your Project<\/h2>\n\n\n\n<p>To incorporate React Router into your application, execute the following command in your terminal from the root directory of your project:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;JavaScript&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">npm install -D react-router-dom<\/pre><\/div>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Note<\/strong>: This tutorial uses React Router v6. If you&#8217;re upgrading from v5, use the @latest flag:<\/p>\n<\/blockquote>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;JavaScript&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">npm install -D react-router-dom@latest<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Folder Structure<\/h2>\n\n\n\n<p>To create a multi-page application, we&#8217;ll organize our files as follows. In the <code>src<\/code> directory, create a <code>pages<\/code> folder with the following files:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>src\/pages\/<\/code>:<\/li>\n\n\n\n<li>Layout.js<\/li>\n\n\n\n<li>Home.js<\/li>\n\n\n\n<li>Articles.js<\/li>\n\n\n\n<li>ContactMe.js<\/li>\n\n\n\n<li>NotFound.js<\/li>\n<\/ul>\n\n\n\n<p>Each of these files will contain a basic React component.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Basic Usage<\/h2>\n\n\n\n<p>Next, we&#8217;ll use our Router in the <code>index.js<\/code> file.<\/p>\n\n\n\n<p>Use React Router to navigate to different pages based on the URL:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;JavaScript&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">import ReactDOM from &quot;react-dom\/client&quot;;\nimport { BrowserRouter, Routes, Route } from &quot;react-router-dom&quot;;\nimport Layout from &quot;.\/pages\/Layout&quot;;\nimport Home from &quot;.\/pages\/Home&quot;;\nimport Articles from &quot;.\/pages\/Articles&quot;;\nimport ContactMe from &quot;.\/pages\/ContactMe&quot;;\nimport NotFound from &quot;.\/pages\/NotFound&quot;;\n\nexport default function App() {\n  return (\n    &lt;BrowserRouter&gt;\n      &lt;Routes&gt;\n        &lt;Route path=&quot;\/&quot; element={&lt;Layout \/&gt;}&gt;\n          &lt;Route index element={&lt;Home \/&gt;} \/&gt;\n          &lt;Route path=&quot;articles&quot; element={&lt;Articles \/&gt;} \/&gt;\n          &lt;Route path=&quot;contact-me&quot; element={&lt;ContactMe \/&gt;} \/&gt;\n          &lt;Route path=&quot;*&quot; element={&lt;NotFound \/&gt;} \/&gt;\n        &lt;\/Route&gt;\n      &lt;\/Routes&gt;\n    &lt;\/BrowserRouter&gt;\n  );\n}\n\nconst root = ReactDOM.createRoot(document.getElementById('root'));\nroot.render(&lt;App \/&gt;);<\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Example Explanation<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>First, we wrap our content with <code>&lt;BrowserRouter&gt;<\/code>. Then, we define our <code>&lt;Routes&gt;<\/code>. An application can have multiple <code>&lt;Routes&gt;<\/code> components, but our basic example uses just one.<\/li>\n\n\n\n<li><code>&lt;Route&gt;<\/code> elements can be nested. The first <code>&lt;Route&gt;<\/code> has a path of <code>\/<\/code> and renders the <code>Layout<\/code> component. The nested <code>&lt;Route&gt;<\/code> elements inherit and extend the parent route. For instance, the <code>articles<\/code> path becomes <code>\/articles<\/code>.<\/li>\n\n\n\n<li>The <code>Home<\/code> component&#8217;s route has no path but includes an <code>index<\/code> attribute, designating it as the default route for the parent path, which is <code>\/<\/code>. Setting the path to <code>*<\/code> acts as a catch-all for undefined URLs, which is useful for a 404 error page.<\/li>\n<\/ul>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Pages \/ Components<\/h2>\n\n\n\n<p>The <code>Layout<\/code> component includes <code>&lt;Outlet><\/code> and <code>&lt;Link><\/code> elements. The <code>&lt;Outlet><\/code> renders the matched child route, while <code>&lt;Link><\/code> is used to set the URL and maintain browsing history. For internal navigation, we use <code>&lt;Link><\/code> instead of <code>&lt;a href=\"\"><\/code>.<\/p>\n\n\n\n<p>The &#8220;layout route&#8221; is a shared component that displays common content across all pages, like a navigation menu.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Layout.js:<\/h3>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;JavaScript&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">import { Outlet, Link } from &quot;react-router-dom&quot;;\n\nconst Layout = () =&gt; {\n  return (\n    &lt;&gt;\n      &lt;nav&gt;\n        &lt;ul&gt;\n          &lt;li&gt;\n            &lt;Link to=&quot;\/&quot;&gt;Home&lt;\/Link&gt;\n          &lt;\/li&gt;\n          &lt;li&gt;\n            &lt;Link to=&quot;\/articles&quot;&gt;Articles&lt;\/Link&gt;\n          &lt;\/li&gt;\n          &lt;li&gt;\n            &lt;Link to=&quot;\/contact-me&quot;&gt;Contact Me&lt;\/Link&gt;\n          &lt;\/li&gt;\n        &lt;\/ul&gt;\n      &lt;\/nav&gt;\n\n      &lt;Outlet \/&gt;\n    &lt;\/&gt;\n  );\n};\n\nexport default Layout;<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Home.js:<\/h3>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;JavaScript&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">const Home = () =&gt; {\n  return &lt;h1&gt;Home&lt;\/h1&gt;;\n};\n\nexport default Home;<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Articles.js:<\/h3>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;JavaScript&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">const Articles = () =&gt; {\n  return &lt;h1&gt;Articles&lt;\/h1&gt;;\n};\n\nexport default Articles;<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">ContactMe.js:<\/h3>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;JavaScript&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">const ContactMe = () =&gt; {\n  return &lt;h1&gt;Contact Me&lt;\/h1&gt;;\n};\n\nexport default ContactMe;<\/pre><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">NotFound.js:<\/h3>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre class=\"CodeMirror\" data-setting=\"{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text\/javascript&quot;,&quot;theme&quot;:&quot;material&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;JavaScript&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}\">const NotFound = () =&gt; {\n  return &lt;h1&gt;404 - Page Not Found&lt;\/h1&gt;;\n};\n\nexport default NotFound;<\/pre><\/div>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>While Create React App doesn&#8217;t include page routing out-of-the-box, React Router is the most popular solution for handling routing in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-74","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>React Router - React Tutorial<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techkubo.com\/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 Tutorial\" \/>\n<meta property=\"og:description\" content=\"While Create React App doesn&#8217;t include page routing out-of-the-box, React Router is the most popular solution for handling routing in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techkubo.com\/react\/react-router\/\" \/>\n<meta property=\"og:site_name\" content=\"React Tutorial\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-22T04:42:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-19T09:41:40+00:00\" \/>\n<meta name=\"author\" content=\"Manong\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Manong\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/techkubo.com\/react\/react-router\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/react\/react-router\/\"},\"author\":{\"name\":\"Manong\",\"@id\":\"https:\/\/techkubo.com\/react\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965\"},\"headline\":\"React Router\",\"datePublished\":\"2025-01-22T04:42:43+00:00\",\"dateModified\":\"2025-05-19T09:41:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/techkubo.com\/react\/react-router\/\"},\"wordCount\":289,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/techkubo.com\/react\/#organization\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/techkubo.com\/react\/react-router\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/techkubo.com\/react\/react-router\/\",\"url\":\"https:\/\/techkubo.com\/react\/react-router\/\",\"name\":\"React Router - React Tutorial\",\"isPartOf\":{\"@id\":\"https:\/\/techkubo.com\/react\/#website\"},\"datePublished\":\"2025-01-22T04:42:43+00:00\",\"dateModified\":\"2025-05-19T09:41:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/techkubo.com\/react\/react-router\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/techkubo.com\/react\/react-router\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/techkubo.com\/react\/react-router\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/techkubo.com\/react\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"React Router\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/techkubo.com\/react\/#website\",\"url\":\"https:\/\/techkubo.com\/react\/\",\"name\":\"React Tutorial\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/techkubo.com\/react\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/techkubo.com\/react\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/techkubo.com\/react\/#organization\",\"name\":\"React Tutorial\",\"url\":\"https:\/\/techkubo.com\/react\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techkubo.com\/react\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/techkubo.com\/react\/wp-content\/uploads\/sites\/10\/2025\/04\/cropped-cropped-Techkubo-logo-1-300x220-1.png\",\"contentUrl\":\"https:\/\/techkubo.com\/react\/wp-content\/uploads\/sites\/10\/2025\/04\/cropped-cropped-Techkubo-logo-1-300x220-1.png\",\"width\":300,\"height\":220,\"caption\":\"React Tutorial\"},\"image\":{\"@id\":\"https:\/\/techkubo.com\/react\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/techkubo.com\/react\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965\",\"name\":\"Manong\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/techkubo.com\/react\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g\",\"caption\":\"Manong\"},\"sameAs\":[\"https:\/\/techkubo.com\"],\"url\":\"https:\/\/techkubo.com\/react\/author\/manong\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"React Router - React Tutorial","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:\/\/techkubo.com\/react\/react-router\/","og_locale":"en_US","og_type":"article","og_title":"React Router - React Tutorial","og_description":"While Create React App doesn&#8217;t include page routing out-of-the-box, React Router is the most popular solution for handling routing in [&hellip;]","og_url":"https:\/\/techkubo.com\/react\/react-router\/","og_site_name":"React Tutorial","article_published_time":"2025-01-22T04:42:43+00:00","article_modified_time":"2025-05-19T09:41:40+00:00","author":"Manong","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Manong","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techkubo.com\/react\/react-router\/#article","isPartOf":{"@id":"https:\/\/techkubo.com\/react\/react-router\/"},"author":{"name":"Manong","@id":"https:\/\/techkubo.com\/react\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965"},"headline":"React Router","datePublished":"2025-01-22T04:42:43+00:00","dateModified":"2025-05-19T09:41:40+00:00","mainEntityOfPage":{"@id":"https:\/\/techkubo.com\/react\/react-router\/"},"wordCount":289,"commentCount":0,"publisher":{"@id":"https:\/\/techkubo.com\/react\/#organization"},"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techkubo.com\/react\/react-router\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techkubo.com\/react\/react-router\/","url":"https:\/\/techkubo.com\/react\/react-router\/","name":"React Router - React Tutorial","isPartOf":{"@id":"https:\/\/techkubo.com\/react\/#website"},"datePublished":"2025-01-22T04:42:43+00:00","dateModified":"2025-05-19T09:41:40+00:00","breadcrumb":{"@id":"https:\/\/techkubo.com\/react\/react-router\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techkubo.com\/react\/react-router\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/techkubo.com\/react\/react-router\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techkubo.com\/react\/"},{"@type":"ListItem","position":2,"name":"React Router"}]},{"@type":"WebSite","@id":"https:\/\/techkubo.com\/react\/#website","url":"https:\/\/techkubo.com\/react\/","name":"React Tutorial","description":"","publisher":{"@id":"https:\/\/techkubo.com\/react\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techkubo.com\/react\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techkubo.com\/react\/#organization","name":"React Tutorial","url":"https:\/\/techkubo.com\/react\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techkubo.com\/react\/#\/schema\/logo\/image\/","url":"https:\/\/techkubo.com\/react\/wp-content\/uploads\/sites\/10\/2025\/04\/cropped-cropped-Techkubo-logo-1-300x220-1.png","contentUrl":"https:\/\/techkubo.com\/react\/wp-content\/uploads\/sites\/10\/2025\/04\/cropped-cropped-Techkubo-logo-1-300x220-1.png","width":300,"height":220,"caption":"React Tutorial"},"image":{"@id":"https:\/\/techkubo.com\/react\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/techkubo.com\/react\/#\/schema\/person\/b4fa2f01fa4ff2a4e98276ce47115965","name":"Manong","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techkubo.com\/react\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21a7455736c21887b8fefe0935012d65?s=96&d=mm&r=g","caption":"Manong"},"sameAs":["https:\/\/techkubo.com"],"url":"https:\/\/techkubo.com\/react\/author\/manong\/"}]}},"_links":{"self":[{"href":"https:\/\/techkubo.com\/react\/wp-json\/wp\/v2\/posts\/74"}],"collection":[{"href":"https:\/\/techkubo.com\/react\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techkubo.com\/react\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techkubo.com\/react\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techkubo.com\/react\/wp-json\/wp\/v2\/comments?post=74"}],"version-history":[{"count":2,"href":"https:\/\/techkubo.com\/react\/wp-json\/wp\/v2\/posts\/74\/revisions"}],"predecessor-version":[{"id":193,"href":"https:\/\/techkubo.com\/react\/wp-json\/wp\/v2\/posts\/74\/revisions\/193"}],"wp:attachment":[{"href":"https:\/\/techkubo.com\/react\/wp-json\/wp\/v2\/media?parent=74"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techkubo.com\/react\/wp-json\/wp\/v2\/categories?post=74"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techkubo.com\/react\/wp-json\/wp\/v2\/tags?post=74"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}