title: React Switch is not exported from 'react-router-dom'
body: <p>I want to add router in my page to route between components. I am using switch to change between route but it is throwing an error as switch is not exported to react router dom. If this the problem with the react version i want to know how to change the code so that i can change between the components.</p>
  <pre><code>// import React from 'react';
  // import Products from './components/Products/Products';
  
  
   import { commerce} from './lib/commerce';
  
  import {Products,Navbar, Cart} from './components';
  import { useState , useEffect} from 'react';
  import { BrowserRouter as Router, Switch , Route } from 'react-router-dom';
  // import { Cart } from '@chec/commerce.js/features/cart';
  
  
  const App=()=&gt; {
      
      const [products,setProducts] = useState([]);
      const [cart,setCart] = useState({});
  
      const fetchProducts = async ()=&gt;{
  
          const {data} = await commerce.products.list();
  
          setProducts(data);
      }
  
      const fetchCart = async () =&gt; {
  
           
           setCart(await commerce.cart.retrieve())
      }
  
  
      const handleAddToCart = async (productId, quantity) =&gt; {
          const item=await commerce.cart.add(productId,quantity);
          setCart(item.cart);
      }
      useEffect(()=&gt;{
  
          fetchProducts();
          fetchCart();
      },[]);
  
  
      console.log(cart)
     
      // console.log(products);
      return (
          
          &lt;Router&gt;
          &lt;div&gt;
              &lt;Navbar totalItems={cart.total_items}/&gt;
              &lt;Switch&gt;
                  &lt;Route exact path=&quot;/&quot;&gt;
                  &lt;Products products={products} onAddtoCart={handleAddToCart}/&gt;
                  &lt;/Route&gt;
                  &lt;Route exact path=&quot;/cart&quot;&gt;
                  &lt;Cart cart={cart}/&gt;
                  &lt;/Route&gt;
           
            
              &lt;/Switch&gt;
          &lt;/div&gt;
          &lt;/Router&gt;
      );
  }
  
  export default App;
  
  </code></pre>