title: React Router V6 - Error: useRoutes() may be used only in the context of a <Router> component
body: <p>I have installed <code>react-router-dom</code>V6-beta. By following the example from a website I am able to use the new option <code>useRoutes</code> I have setup page routes and returning them in the <code>App.js</code> file.</p>
  <p>After saving I am getting the following error:</p>
  <p><em><strong>Error: useRoutes() may be used only in the context of a  component.</strong></em></p>
  <p>I am wondering If I am missing something here? I have created the pages inside the <code>src/pages</code> folder.</p>
  <p>My code:</p>
  <pre><code>import { BrowserRouter, Link, Outlet, useRoutes } from 'react-router-dom';
  
  // Pages
  import Home from './pages/Home';
  import About from './pages/About';
  import Services from './pages/Services';
  import Gallery from './pages/Gallery';
  import Prices from './pages/Prices';
  import Contact from './pages/Contact';
  
  const App = () =&gt; {
      const routes = useRoutes([
          { path: '/', element: &lt;Home /&gt; },
          { path: 'o-nama', element: &lt;About /&gt; },
          { path: 'usluge', element: &lt;Services /&gt; },
          { path: 'galerija', element: &lt;Gallery /&gt; },
          { path: 'cjenovnik', element: &lt;Prices /&gt; },
          { path: 'kontakt', element: &lt;Contact /&gt; }
      ]);
  
      return routes;
  };
  
  export default App;
  </code></pre>