{"id":45708,"date":"2023-05-19T19:52:50","date_gmt":"2023-05-19T10:52:50","guid":{"rendered":"https:\/\/kinsta.com\/jp\/?p=45708&#038;post_type=knowledgebase&#038;preview_id=45708"},"modified":"2025-10-02T04:46:45","modified_gmt":"2025-10-01T19:46:45","slug":"attempted-import-error-switch-is-not-exported-from-react-router-dom","status":"publish","type":"post","link":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/","title":{"rendered":"React \u306e\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217;\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5"},"content":{"rendered":"<p>React Router\u306f\u3001<a href=\"https:\/\/kinsta.com\/jp\/blog\/what-is-react-js\/\">React<\/a>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u7ba1\u7406\u3057\u3001\u30b7\u30fc\u30e0\u30ec\u30b9\u306a\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u6a5f\u80fd\u3092\u63d0\u4f9b\u3059\u308b\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u308b\u4eba\u6c17\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002\u3057\u304b\u3057\u3001\u3069\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3082\u305d\u3046\u3067\u3059\u304c\u3001\u5f90\u3005\u306b\u66f4\u65b0\u3084\u5909\u66f4\u304c\u884c\u308f\u308c\u3001\u4e00\u90e8\u306e\u6a5f\u80fd\u304c\u975e\u63a8\u5968\u3001\u30b5\u30dd\u30fc\u30c8\u5916\u3068\u306a\u308b\u305f\u3081\u3001\u30a8\u30e9\u30fc\u306b\u306a\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>React\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u5b9f\u88c5\u3059\u308b\u969b\u306b\u767a\u751f\u3057\u304c\u3061\u306a\u30a8\u30e9\u30fc\u306b\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217;\u300d\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30a8\u30e9\u30fc\u306f\u3001<a href=\"https:\/\/reactrouter.com\/en\/main\" target=\"_blank\" rel=\"noopener noreferrer\">React Router<\/a>\u306e\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u304b\u3089\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\uff08\u73fe\u5728\u306fv6\uff09\u306b\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3059\u308b\u969b\u306b\u3001<code>&lt;Switch&gt;<\/code>\u306e\u3088\u3046\u306a\u3044\u304f\u3064\u304b\u306e\u975e\u63a8\u5968\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u8003\u616e\u3057\u306a\u3044\u3068\u767a\u751f\u3059\u308b\u6050\u308c\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u4eca\u56de\u306f\u3001React\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30b9\u30e0\u30fc\u30ba\u306a\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3068\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u3092\u78ba\u4fdd\u3059\u308b\u305f\u3081\u306b\u3001\u3053\u306e\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u3068\u89e3\u6c7a\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<div><\/div><kinsta-auto-toc heading=\"Table of Contents\" exclude=\"last\" list-style=\"arrow\" selector=\"h2\" count-number=\"-1\"><\/kinsta-auto-toc>\n<h2>\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217;\u300d\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u3068\u306f<\/h2>\n<p>React Router\u30d0\u30fc\u30b8\u30e7\u30f35\u4ee5\u524d\u3067\u306f\u3001<a href=\"https:\/\/v5.reactrouter.com\/web\/api\/Switch\" target=\"_blank\" rel=\"noopener noreferrer\">React\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30eb\u30fc\u30c8\u3092\u30e9\u30c3\u30d7<\/a>\u3059\u308b\u306e\u306b<code>&lt;Switch&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3057\u305f\u3002React Router\u30d0\u30fc\u30b8\u30e7\u30f36\u3067\u306f\u3001<code>&lt;Switch&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u975e\u63a8\u5968\u3068\u306a\u308a\u3001<code>&lt;Routes&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b<a href=\"https:\/\/reactrouter.com\/en\/main\/upgrading\/v5#upgrade-all-switch-elements-to-routes\" target=\"_blank\" rel=\"noopener noreferrer\">\u7f6e\u304d\u63db\u3048\u3089\u308c\u3066<\/a>\u3044\u307e\u3059\u3002<\/p>\n<p>React Router v6\u306e<code>&lt;Routes&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u3001\u975e\u63a8\u5968\u306e<code>&lt;Switch&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3068\u6bd4\u8f03\u3057\u3066\u3001\u3088\u308a\u5ba3\u8a00\u7684\u3067\u67d4\u8edf\u306a\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u7d50\u679c\u3068\u3057\u3066\u3001React Router v6\uff08\u307e\u305f\u306f\u3088\u308a\u65b0\u3057\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\uff09\u306b\u5207\u308a\u66ff\u3048\u3001\u975e\u63a8\u5968\u306e<code>&lt;Switch&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u305f\u307e\u307e\u3060\u3068\u3001\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217; \u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<figure style=\"width: 1600px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/kinsta.com\/wp-content\/uploads\/2023\/04\/switch-react-router-error.jpg\" alt=\"\u300c'Switch' is not exported from 'react-router-dom' \u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc\" width=\"1600\" height=\"255\"><figcaption class=\"wp-caption-text\">\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217; \u300d\u3068\u3044\u3046\u30a8\u30e9\u30fc<\/figcaption><\/figure>\n\n<h2>\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217;\u300d\u30a8\u30e9\u30fc\u306e2\u3064\u306e\u5bfe\u51e6\u65b9\u6cd5<\/h2>\n<p>\u3053\u306e\u30a8\u30e9\u30fc\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u8981\u4ef6\u306b\u5fdc\u3058\u3066\u30012\u3064\u306e\u65b9\u6cd5\u3067\u5bfe\u51e6\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u305d\u306e2\u3064\u306e\u65b9\u6cd5\u3068\u306f\u3001\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>&lt;Switch&gt;\u306e\u4ee3\u308f\u308a\u306b&lt;Routes&gt;\u3092\u4f7f\u7528\u3059\u308b<\/li>\n<li><strong>react-router-dom<\/strong>\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30925\u4ee5\u4e0b\u306b\u30c0\u30a6\u30f3\u30b0\u30ec\u30fc\u30c9\u3059\u308b<\/li>\n<\/ul>\n<h3>1. &lt;Switch&gt;\u306e\u4ee3\u308f\u308a\u306b&lt;Routes&gt;\u3092\u4f7f\u7528\u3059\u308b<\/h3>\n<p>\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217;\u300d\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b\u4e00\u3064\u306e\u65b9\u6cd5\u304c\u3001<code>&lt;Switch&gt;<\/code>\u3092<code>&lt;Routes&gt;<\/code>\u306b\u7f6e\u304d\u63db\u3048\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3068\u3057\u3066\u3001React Router\u30d0\u30fc\u30b8\u30e7\u30f35\u3067\u975e\u63a8\u5968\u306e<code>&lt;Switch&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u30b3\u30fc\u30c9\u3092\u3001React Router\u30d0\u30fc\u30b8\u30e7\u30f36\u306e\u65b0\u3057\u3044<code>&lt;Routes&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u66f4\u65b0\u3059\u308b\u65b9\u6cd5\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>React Router\u30d0\u30fc\u30b8\u30e7\u30f35\u3067\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre><code class=\"language-jsx\">import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';\nimport Home from '.\/components\/Home';\nimport About from '.\/components\/About';\nimport Contact from '.\/components\/Contact';\n\nconst App = () =&gt; {\n  return (\n    &lt;Router&gt;\n      &lt;Switch&gt;\n        &lt;Route exact path=\"\/\" component={Home} \/&gt;\n        &lt;Route path=\"\/about\" component={About} \/&gt;\n        &lt;Route path=\"\/contact\" component={Contact} \/&gt;\n      &lt;\/Switch&gt;\n    &lt;\/Router&gt;\n  );\n};\n\nexport default App;<\/code><\/pre>\n<p>\u4e0a\u8a18\u306e\u30b3\u30fc\u30c9\u3067\u306f\u3001<code>&lt;Switch&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3066\u30eb\u30fc\u30c8\u3092\u30e9\u30c3\u30d7\u3057\u3066\u3044\u307e\u3059\u3002\u3057\u304b\u3057\u3001React Router\u30d0\u30fc\u30b8\u30e7\u30f36\u3067\u306f\u3001<code>&lt;Routes&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f7f\u7528\u3057\u3001\u6700\u65b0\u306e<a href=\"https:\/\/kinsta.com\/blog\/microservices-vs-api\/\">API<\/a>\u306b\u5f93\u3046\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u3001\u540c\u3058\u4f8b\u3092\u30d0\u30fc\u30b8\u30e7\u30f36\u4ee5\u964d\u306eReact Router\u306e\u3082\u306e\u306b\u66f8\u304d\u63db\u3048\u3066\u307f\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-jsx\">import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';\nimport Home from '.\/components\/Home';\nimport About from '.\/components\/About';\nimport Contact from '.\/components\/Contact';\n\nconst App = () =&gt; {\n  return (\n    &lt;Router&gt;\n      &lt;Routes&gt;\n        &lt;Route path=\"\/\" element={&lt;Home \/&gt;} \/&gt;\n        &lt;Route path=\"\/about\" element={&lt;About \/&gt;} \/&gt;\n        &lt;Route path=\"\/contact\" element={&lt;Contact \/&gt;} \/&gt;\n      &lt;\/Routes&gt;\n    &lt;\/Router&gt;\n  );\n};\n\nexport default App;<\/code><\/pre>\n<p>\u3054\u89a7\u306e\u3088\u3046\u306b\u3001<code>&lt;Switch&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092<code>&lt;Routes&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u7f6e\u304d\u63db\u3048\u3001\u5404<code>&lt;Route&gt;<\/code>\u306f<code>component<\/code>\u306e\u4ee3\u308f\u308a\u306b<code>element<\/code>\u3092\u4f7f\u7528\u3057\u3066\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<aside role=\"note\" class=\"wp-block-kinsta-notice is-style-info\">\n            <h3>Info<\/h3>\n        <p>React Router\u30d0\u30fc\u30b8\u30e7\u30f36\u3067\u306f\u3001<code>exact<\/code>\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u52d5\u4f5c\u3068\u306a\u308b\u305f\u3081\u3001\u4e0d\u8981\u306b\u306a\u308a\u307e\u3057\u305f\u3002\u307e\u305f\u3001<code>&lt;Route&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u3001\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u5272\u308a\u5f53\u3066\u308b\u305f\u3081\u306b<code>component={Home}<\/code>\u3092\u4f7f\u7528\u3057\u306a\u304f\u306a\u308a\u3001<code>element={&lt;Contact\/&gt;}<\/code>\u3092\u4f7f\u7528\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<\/aside>\n\n<h4>React Router v6\u306b\u304a\u3051\u308bSwitch\u3092\u8d85\u3048\u308bRoutes\u306e\u512a\u4f4d\u6027<\/h4>\n<p>React Router v6\u306e\u30ea\u30ea\u30fc\u30b9\u3067\u306f\u3001<code>&lt;Routes&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u5c0e\u5165\u306b\u3088\u308a\u3001\u4ee5\u524d\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u306e\uff08\u73fe\u5728\u306f\u975e\u63a8\u5968\u3067\u3042\u308b\uff09<code>&lt;Switch&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u6bd4\u3079\u3066\u3044\u304f\u3064\u3082\u306e\u6539\u5584\u70b9\u304c\u3082\u305f\u3089\u3055\u308c\u307e\u3057\u305f\u3002<\/p>\n<p>\u7d9a\u3044\u3066\u306f\u3001React\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30ed\u30b8\u30c3\u30af\u3092\u51e6\u7406\u3059\u308b\u306e\u306b<code>&lt;Routes&gt;<\/code>\u3092\u4f7f\u7528\u3059\u308b\u5229\u70b9\u3092\u7c21\u5358\u306b\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<h5>1. \u30cd\u30b9\u30c8\u3055\u308c\u305f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u306e\u6539\u5584<\/h5>\n<p><code>&lt;Routes&gt;<\/code>\u3067\u306f<code>&lt;Switch&gt;<\/code>\u306b\u6bd4\u3079\u3066\u3001\u30cd\u30b9\u30c8\u3055\u308c\u305f\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u3088\u308a\u512a\u308c\u305f\u65b9\u6cd5\u3067\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<code>&lt;Routes&gt;<\/code>\u3067\u306f\u3001<code>&lt;Route&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4ed6\u306e<code>&lt;Route&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u30cd\u30b9\u30c8\u3055\u305b\u308b\u3053\u3068\u3067\u7c21\u5358\u306b\u30eb\u30fc\u30c8\u3092\u5b9a\u7fa9\u3057\u3001\u8907\u96d1\u306a\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u69cb\u9020\u3092\u3088\u308a\u76f4\u611f\u7684\u304b\u3064\u6574\u7406\u3057\u3066\u8a2d\u8a08\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u306b\u3088\u308a\u3001\u8907\u6570\u306e\u30ec\u30d9\u30eb\u306e\u30cd\u30b9\u30c8\u3055\u308c\u305f\u30eb\u30fc\u30c8\u3092\u6301\u3064\u5927\u898f\u6a21\u306a\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u304a\u3044\u3066\u3001\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u30ed\u30b8\u30c3\u30af\u306e\u7ba1\u7406\u3092\u7c21\u7d20\u5316\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-jsx\">&lt;Routes&gt;\n  &lt;Route path=\"\/\" element={&lt;Home \/&gt;} \/&gt;\n  &lt;Route path=\"\/about\" element={&lt;About \/&gt;}&gt;\n    &lt;Route path=\"\/team\" element={&lt;Team \/&gt;} \/&gt;\n    &lt;Route path=\"\/history\" element={&lt;History \/&gt;} \/&gt;\n  &lt;\/Route&gt;\n  &lt;Route path=\"\/contact\" element={&lt;Contact \/&gt;} \/&gt;\n&lt;\/Routes&gt;<\/code><\/pre>\n<h5>2. \u30c0\u30a4\u30ca\u30df\u30c3\u30af\u30eb\u30fc\u30c8\u30de\u30c3\u30c1\u30f3\u30b0<\/h5>\n<p><code>&lt;Routes&gt;<\/code>\u306f\u3001\u30eb\u30fc\u30c8\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u57fa\u3065\u3044\u3066\u52d5\u7684\u306b\u30eb\u30fc\u30c8\u3092\u30de\u30c3\u30c1\u30f3\u30b0\u3057\u3001\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3059\u308b\u3053\u3068\u3067\u3001\u3088\u308a\u67d4\u8edf\u306a\u5bfe\u5fdc\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u3088\u308a\u52d5\u7684\u304b\u3064\u30c7\u30fc\u30bf\u99c6\u52d5\u578b\u306e\u30eb\u30fc\u30c6\u30a3\u30f3\u30b0\u3092\u884c\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-jsx\">&lt;Routes&gt;\n  &lt;Route path=\"\/\" element={&lt;Home \/&gt;} \/&gt;\n  &lt;Route path=\"\/users\/:userId\" element={&lt;UserProfile \/&gt;} \/&gt;\n  &lt;Route path=\"\/products\/:productId\" element={&lt;ProductDetail \/&gt;} \/&gt;\n&lt;\/Routes&gt;<\/code><\/pre>\n<h5>3. \u30a8\u30e9\u30fc\u51e6\u7406\u306e\u6539\u5584<\/h5>\n<p><code>&lt;Routes&gt;<\/code>\u3067\u306f\u3001\u4e00\u81f4\u3057\u306a\u3044\u30eb\u30fc\u30c8\u306b\u5bfe\u3059\u308b\u30a8\u30e9\u30fc\u51e6\u7406\u3082\u6539\u5584\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u30eb\u30fc\u30c8\u304c\u898b\u3064\u304b\u3089\u306a\u3044\u5834\u5408\u3001<code>&lt;Routes&gt;<\/code>\u306f\u81ea\u52d5\u7684\u306b\u300cNot Found\u300d\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\uff08\u307e\u305f\u306f\u5b9a\u7fa9\u3057\u305f\u30ab\u30b9\u30bf\u30e0\u30a8\u30e9\u30fc\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\uff09\u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306b\u3088\u308a\u3001\u7121\u52b9\u306aURL\u3084\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u5b58\u5728\u3057\u306a\u3044\u30eb\u30fc\u30c8\u3092\u81e8\u6a5f\u5fdc\u63f4\u306b\u51e6\u7406\u3057\u3001\u30e6\u30fc\u30b6\u30fc\u30a8\u30af\u30b9\u30da\u30ea\u30a8\u30f3\u30b9\u3092\u5411\u4e0a\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-jsx\">&lt;Routes&gt;\n  &lt;Route path=\"\/\" element={&lt;Home \/&gt;} \/&gt;\n  &lt;Route path=\"\/about\" element={&lt;About \/&gt;} \/&gt;\n  {\/* Error route *\/}\n  &lt;Route path=\"*\" element={&lt;NotFound \/&gt;} \/&gt;\n&lt;\/Routes&gt;<\/code><\/pre>\n<h3>2. react-router-dom\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30925\u4ee5\u4e0b\u306b\u4e0b\u3052\u308b<\/h3>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067<code>&lt;Switch&gt;<\/code>\u306e\u4f7f\u7528\u3092\u7d99\u7d9a\u3057\u305f\u3044\u5834\u5408\u306b\u306f\u3001<strong>react-router-dom<\/strong>\u306e\u30d0\u30fc\u30b8\u30e7\u30f3\u30925\u4ee5\u4e0b\u306b\u30c0\u30a6\u30f3\u30b0\u30ec\u30fc\u30c9\u3057\u3001\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001\u3059\u3067\u306b\u53e4\u3044\u30d0\u30fc\u30b8\u30e7\u30f3\u306eReact Router\u3092\u4f7f\u7528\u3057\u3066\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u69cb\u7bc9\u3057\u3066\u3044\u308b\u5834\u5408\u306b\u306f\u3001\u6709\u52b9\u306a\u89e3\u6c7a\u7b56\u3068\u306a\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\u307e\u305a\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066React router\u306e\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u3092\u30a2\u30f3\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">npm uninstall react-router-dom<\/code><\/pre>\n<p>\u7d9a\u3044\u3066\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001&lt;Switch&gt;\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u542b\u3080\u6700\u5f8c\u306e\u30e1\u30b8\u30e3\u30fc\u30ea\u30ea\u30fc\u30b9\u3067\u3042\u308b\u30d0\u30fc\u30b8\u30e7\u30f35.2.0\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-bash\">npm install react-router-dom@5.2.0<\/code><\/pre>\n\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001React\u306e\u30a8\u30e9\u30fc\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217; \u300d\u306b\u3064\u3044\u3066\u5b66\u3073\u3001\u305d\u308c\u3092\u89e3\u6c7a\u3059\u308b\u3044\u304f\u3064\u304b\u306e\u65b9\u6cd5\u3092\u63a2\u308a\u307e\u3057\u305f\u3002\u307e\u305f\u3001\u975e\u63a8\u5968\u306e<code>&lt;Switch&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3067\u306f\u306a\u304f\u3001\u65b0\u3057\u3044<code>&lt;Routes&gt;<\/code>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f7f\u7528\u3059\u308b\u30e1\u30ea\u30c3\u30c8\u3082\u3054\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u65b0\u305f\u306b\u7acb\u3061\u4e0a\u3052\u308b\u969b\u306b\u306f\u3001\u5e38\u306b\u6700\u65b0\u30d0\u30fc\u30b8\u30e7\u30f3\u306eReact Router\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3092\u304a\u52e7\u3081\u3057\u307e\u3059\u3002\u5b9f\u969b\u306b\u5927\u5e45\u306a\u6539\u5584\u3068\u7d99\u7d9a\u7684\u306a\u30a2\u30c3\u30d7\u30c7\u30fc\u30c8\u304c\u5b9f\u73fe\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3068\u306f\u8a00\u3048\u3001\u65e2\u5b58\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u53d6\u308a\u7d44\u3093\u3067\u3044\u3066\u3001React Router v6\u306e\u69cb\u6587\u3068\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u3042\u308f\u305b\u3066\u30b3\u30fc\u30c9\u3092\u5e83\u7bc4\u56f2\u306b\u8abf\u6574\u3059\u308b\u6642\u9593\u304c\u306a\u3044\u306e\u3067\u3042\u308c\u3070\u3001\u65e7\u30d0\u30fc\u30b8\u30e7\u30f3\u306eReact Router\u306b\u5207\u308a\u66ff\u3048\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><em>\u3042\u306a\u305f\u306f\u3001\u3053\u306e\u554f\u984c\u306b\u76f4\u9762\u3057\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u304b\uff1f\u3069\u306e\u3088\u3046\u306b\u89e3\u6c7a\u3057\u305f\u3067\u3057\u3087\u3046\u304b\u3002\u307e\u305f\u3001\u3053\u306e\u8a18\u4e8b\u3067\u53d6\u308a\u4e0a\u3052\u3066\u3044\u306a\u3044\u4ed6\u306e\u30a2\u30d7\u30ed\u30fc\u30c1\u3092\u3054\u5b58\u77e5\u3067\u3057\u3087\u3046\u304b\uff1f\u30b3\u30e1\u30f3\u30c8\u6b04\u3067\u304a\u805e\u304b\u305b\u304f\u3060\u3055\u3044\u3002<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>React Router\u306f\u3001React\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7 &#8230;<\/p>\n","protected":false},"author":287,"featured_media":45709,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kinsta_gated_content":false,"_kinsta_gated_content_redirect":"","footnotes":""},"tags":[],"topic":[802,803],"class_list":["post-45708","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","topic-react","topic-react-errors"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v24.6 (Yoast SEO v24.6) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>React \u306e\u300c&#039;Switch&#039; is not exported from &#039;react-router-dom&#039;\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5\uff5cKinsta\u00ae<\/title>\n<meta name=\"description\" content=\"\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8\u3067\u306f\u300c&#039;switch&#039; is not exported from &#039;react-router-dom&#039;\u300d\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b2\u3064\u306e\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/\" \/>\n<meta property=\"og:locale\" content=\"ja_JP\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"React \u306e\u300c&#039;Switch&#039; is not exported from &#039;react-router-dom&#039;\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5\" \/>\n<meta property=\"og:description\" content=\"\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8\u3067\u306f\u300c&#039;switch&#039; is not exported from &#039;react-router-dom&#039;\u300d\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b2\u3064\u306e\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/\" \/>\n<meta property=\"og:site_name\" content=\"Kinsta\u00ae\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/Kinsta-Japan-334616080691171\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-19T10:52:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-10-01T19:46:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1500\" \/>\n\t<meta property=\"og:image:height\" content=\"750\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Joel Olawanle\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:description\" content=\"\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8\u3067\u306f\u300c&#039;switch&#039; is not exported from &#039;react-router-dom&#039;\u300d\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b2\u3064\u306e\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@olawanle_joel\" \/>\n<meta name=\"twitter:site\" content=\"@Kinsta_JP\" \/>\n<meta name=\"twitter:label1\" content=\"\u57f7\u7b46\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"Joel Olawanle\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/\"},\"author\":{\"name\":\"Joel Olawanle\",\"@id\":\"https:\/\/kinsta.com\/jp\/#\/schema\/person\/efa7de30245ca15be5ce1dcacff89c07\"},\"headline\":\"React \u306e\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217;\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5\",\"datePublished\":\"2023-05-19T10:52:50+00:00\",\"dateModified\":\"2025-10-01T19:46:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/\"},\"wordCount\":152,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/kinsta.com\/jp\/#organization\"},\"image\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg\",\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/\",\"url\":\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/\",\"name\":\"React \u306e\u300c'Switch' is not exported from 'react-router-dom'\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5\uff5cKinsta\u00ae\",\"isPartOf\":{\"@id\":\"https:\/\/kinsta.com\/jp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg\",\"datePublished\":\"2023-05-19T10:52:50+00:00\",\"dateModified\":\"2025-10-01T19:46:45+00:00\",\"description\":\"\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8\u3067\u306f\u300c'switch' is not exported from 'react-router-dom'\u300d\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b2\u3064\u306e\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#breadcrumb\"},\"inLanguage\":\"ja\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#primaryimage\",\"url\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg\",\"contentUrl\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg\",\"width\":1500,\"height\":750,\"caption\":\"React \u306e\u300c'Switch' is not exported from 'react-router-dom'\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/kinsta.com\/jp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"React\",\"item\":\"https:\/\/kinsta.com\/jp\/topics\/react\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"React \u306e\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217;\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/kinsta.com\/jp\/#website\",\"url\":\"https:\/\/kinsta.com\/jp\/\",\"name\":\"Kinsta\u00ae\",\"description\":\"\u9ad8\u901f\u304b\u3064\u5805\u7262\u306a\u30d7\u30ec\u30df\u30a2\u30e0\u30b5\u30fc\u30d0\u30fc\u30b5\u30fc\u30d3\u30b9\",\"publisher\":{\"@id\":\"https:\/\/kinsta.com\/jp\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/kinsta.com\/jp\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ja\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/kinsta.com\/jp\/#organization\",\"name\":\"Kinsta\",\"url\":\"https:\/\/kinsta.com\/jp\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/kinsta.com\/jp\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/12\/kinsta-logo.jpeg\",\"contentUrl\":\"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/12\/kinsta-logo.jpeg\",\"width\":500,\"height\":500,\"caption\":\"Kinsta\"},\"image\":{\"@id\":\"https:\/\/kinsta.com\/jp\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/Kinsta-Japan-334616080691171\/\",\"https:\/\/x.com\/Kinsta_JP\",\"https:\/\/www.instagram.com\/kinstahosting\/\",\"https:\/\/www.linkedin.com\/company\/kinsta\/\",\"https:\/\/www.pinterest.com\/kinstahosting\/\",\"https:\/\/www.youtube.com\/c\/Kinsta\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/kinsta.com\/jp\/#\/schema\/person\/efa7de30245ca15be5ce1dcacff89c07\",\"name\":\"Joel Olawanle\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ja\",\"@id\":\"https:\/\/kinsta.com\/jp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/051bf577ce2c837846a1db9eef184758?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/051bf577ce2c837846a1db9eef184758?s=96&d=mm&r=g\",\"caption\":\"Joel Olawanle\"},\"description\":\"Joel is a Frontend developer working at Kinsta as a Technical Editor. He is a passionate teacher with love for open source and has written over 300 technical articles majorly around JavaScript and it's frameworks.\",\"sameAs\":[\"https:\/\/joelolawanle.com\/\",\"https:\/\/www.linkedin.com\/in\/olawanlejoel\/\",\"https:\/\/x.com\/olawanle_joel\",\"https:\/\/www.youtube.com\/@joelolawanle\"],\"gender\":\"male\",\"knowsAbout\":[\"JavaScript\",\"React\",\"Next.js\"],\"knowsLanguage\":[\"English\"],\"jobTitle\":\"Technical Editor\",\"worksFor\":\"Kinsta\",\"url\":\"https:\/\/kinsta.com\/jp\/blog\/author\/joelolawanle\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"React \u306e\u300c'Switch' is not exported from 'react-router-dom'\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5\uff5cKinsta\u00ae","description":"\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8\u3067\u306f\u300c'switch' is not exported from 'react-router-dom'\u300d\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b2\u3064\u306e\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002","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:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/","og_locale":"ja_JP","og_type":"article","og_title":"React \u306e\u300c'Switch' is not exported from 'react-router-dom'\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5","og_description":"\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8\u3067\u306f\u300c'switch' is not exported from 'react-router-dom'\u300d\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b2\u3064\u306e\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002","og_url":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/","og_site_name":"Kinsta\u00ae","article_publisher":"https:\/\/www.facebook.com\/Kinsta-Japan-334616080691171\/","article_published_time":"2023-05-19T10:52:50+00:00","article_modified_time":"2025-10-01T19:46:45+00:00","og_image":[{"width":1500,"height":750,"url":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg","type":"image\/jpeg"}],"author":"Joel Olawanle","twitter_card":"summary_large_image","twitter_description":"\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8\u3067\u306f\u300c'switch' is not exported from 'react-router-dom'\u300d\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b2\u3064\u306e\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002","twitter_image":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg","twitter_creator":"@olawanle_joel","twitter_site":"@Kinsta_JP","twitter_misc":{"\u57f7\u7b46\u8005":"Joel Olawanle","\u63a8\u5b9a\u8aad\u307f\u53d6\u308a\u6642\u9593":"3\u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#article","isPartOf":{"@id":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/"},"author":{"name":"Joel Olawanle","@id":"https:\/\/kinsta.com\/jp\/#\/schema\/person\/efa7de30245ca15be5ce1dcacff89c07"},"headline":"React \u306e\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217;\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5","datePublished":"2023-05-19T10:52:50+00:00","dateModified":"2025-10-01T19:46:45+00:00","mainEntityOfPage":{"@id":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/"},"wordCount":152,"commentCount":0,"publisher":{"@id":"https:\/\/kinsta.com\/jp\/#organization"},"image":{"@id":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#primaryimage"},"thumbnailUrl":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg","inLanguage":"ja","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/","url":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/","name":"React \u306e\u300c'Switch' is not exported from 'react-router-dom'\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5\uff5cKinsta\u00ae","isPartOf":{"@id":"https:\/\/kinsta.com\/jp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#primaryimage"},"image":{"@id":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#primaryimage"},"thumbnailUrl":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg","datePublished":"2023-05-19T10:52:50+00:00","dateModified":"2025-10-01T19:46:45+00:00","description":"\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8\u3067\u306f\u300c'switch' is not exported from 'react-router-dom'\u300d\u30a8\u30e9\u30fc\u3092\u89e3\u6c7a\u3059\u308b2\u3064\u306e\u65b9\u6cd5\u3092\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002","breadcrumb":{"@id":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#breadcrumb"},"inLanguage":"ja","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/"]}]},{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#primaryimage","url":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg","contentUrl":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/05\/attempted-import-error-featured.jpg","width":1500,"height":750,"caption":"React \u306e\u300c'Switch' is not exported from 'react-router-dom'\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5"},{"@type":"BreadcrumbList","@id":"https:\/\/kinsta.com\/jp\/blog\/attempted-import-error-switch-is-not-exported-from-react-router-dom\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kinsta.com\/jp\/"},{"@type":"ListItem","position":2,"name":"React","item":"https:\/\/kinsta.com\/jp\/topics\/react\/"},{"@type":"ListItem","position":3,"name":"React \u306e\u300c&#8217;Switch&#8217; is not exported from &#8216;react-router-dom&#8217;\u300d\u30a8\u30e9\u30fc\u306e\u89e3\u6c7a\u65b9\u6cd5"}]},{"@type":"WebSite","@id":"https:\/\/kinsta.com\/jp\/#website","url":"https:\/\/kinsta.com\/jp\/","name":"Kinsta\u00ae","description":"\u9ad8\u901f\u304b\u3064\u5805\u7262\u306a\u30d7\u30ec\u30df\u30a2\u30e0\u30b5\u30fc\u30d0\u30fc\u30b5\u30fc\u30d3\u30b9","publisher":{"@id":"https:\/\/kinsta.com\/jp\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kinsta.com\/jp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ja"},{"@type":"Organization","@id":"https:\/\/kinsta.com\/jp\/#organization","name":"Kinsta","url":"https:\/\/kinsta.com\/jp\/","logo":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/kinsta.com\/jp\/#\/schema\/logo\/image\/","url":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/12\/kinsta-logo.jpeg","contentUrl":"https:\/\/kinsta.com\/jp\/wp-content\/uploads\/sites\/6\/2023\/12\/kinsta-logo.jpeg","width":500,"height":500,"caption":"Kinsta"},"image":{"@id":"https:\/\/kinsta.com\/jp\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/Kinsta-Japan-334616080691171\/","https:\/\/x.com\/Kinsta_JP","https:\/\/www.instagram.com\/kinstahosting\/","https:\/\/www.linkedin.com\/company\/kinsta\/","https:\/\/www.pinterest.com\/kinstahosting\/","https:\/\/www.youtube.com\/c\/Kinsta"]},{"@type":"Person","@id":"https:\/\/kinsta.com\/jp\/#\/schema\/person\/efa7de30245ca15be5ce1dcacff89c07","name":"Joel Olawanle","image":{"@type":"ImageObject","inLanguage":"ja","@id":"https:\/\/kinsta.com\/jp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/051bf577ce2c837846a1db9eef184758?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/051bf577ce2c837846a1db9eef184758?s=96&d=mm&r=g","caption":"Joel Olawanle"},"description":"Joel is a Frontend developer working at Kinsta as a Technical Editor. He is a passionate teacher with love for open source and has written over 300 technical articles majorly around JavaScript and it's frameworks.","sameAs":["https:\/\/joelolawanle.com\/","https:\/\/www.linkedin.com\/in\/olawanlejoel\/","https:\/\/x.com\/olawanle_joel","https:\/\/www.youtube.com\/@joelolawanle"],"gender":"male","knowsAbout":["JavaScript","React","Next.js"],"knowsLanguage":["English"],"jobTitle":"Technical Editor","worksFor":"Kinsta","url":"https:\/\/kinsta.com\/jp\/blog\/author\/joelolawanle\/"}]}},"acf":[],"_links":{"self":[{"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/posts\/45708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/users\/287"}],"replies":[{"embeddable":true,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/comments?post=45708"}],"version-history":[{"count":7,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/posts\/45708\/revisions"}],"predecessor-version":[{"id":46764,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/posts\/45708\/revisions\/46764"}],"alternate":[{"embeddable":true,"hreflang":"en","title":"English","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/45708\/translations\/en"},{"embeddable":true,"hreflang":"it","title":"Italian","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/45708\/translations\/it"},{"embeddable":true,"hreflang":"pt","title":"Portuguese","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/45708\/translations\/pt"},{"embeddable":true,"hreflang":"fr","title":"French","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/45708\/translations\/fr"},{"embeddable":true,"hreflang":"de","title":"German","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/45708\/translations\/de"},{"embeddable":true,"hreflang":"ja","title":"Japanese","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/45708\/translations\/jp"},{"embeddable":true,"hreflang":"nl","title":"Dutch","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/45708\/translations\/nl"},{"embeddable":true,"hreflang":"es","title":"Spanish","href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/45708\/translations\/es"},{"href":"https:\/\/kinsta.com\/jp\/wp-json\/kinsta\/v1\/posts\/45708\/tree"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/media\/45709"}],"wp:attachment":[{"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/media?parent=45708"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/tags?post=45708"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/kinsta.com\/jp\/wp-json\/wp\/v2\/topic?post=45708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}