title: I'm facing this error in client side in React,js
body: <p>index.js</p>
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  
  import App from './App';
  
  ReactDOM.render(&lt;App /&gt;, document.querySelector('#root'));
  </code></pre>
  <p>App.js</p>
  <pre><code>import React from 'react';
  
  import { BrowserRouter, Routes, Route } from 'react-router-dom';
  
  import Join from './components/Join';
  import Chat from './components/Chat';
  
  const App = () =&gt; (
      &lt;Routes&gt;
          &lt;Route path='/' exact component={Join} /&gt;
          &lt;Route path='/chat' component={Chat} /&gt;
      &lt;/Routes&gt;
  );
  
  export default App;
  </code></pre>
  <p>It thows error like &quot;Error: useRoutes() may be used only in the context of a  component.&quot;</p>
  <p>Here is the ERROR:
  <img src="https://i.stack.imgur.com/qk9Dj.png" alt="" />&quot;</p>