title: What causes the typescript Module has no exported member .ts(2305) error and how do you fix it?
body: <p>This is my first time using typescript with React and I'm have a tremendous amount of trouble with the typescript <code>Module has no exported member .ts(2305)</code> error. Here are 2 examples of this happening:</p>
  <pre><code>import { BrowserRouter, Routes, Route } from 'react-router-dom';
  </code></pre>
  <p>Error:</p>
  <pre><code>'&quot;react-router-dom&quot;' has no exported member named 'Routes'. Did you mean 'Route'?ts(2724)
  </code></pre>
  <p>And here</p>
  <pre><code>import { useNavigate } from 'react-router';
  </code></pre>
  <p>Error:</p>
  <pre><code>Module '&quot;react-router&quot;' has no exported member 'useNavigate'.ts(2305)
  </code></pre>
  <p>Last example:</p>
  <pre><code>import { MaterialCommunityIcons } from 'react-native-vector-icons';
  </code></pre>
  <p>Error:</p>
  <pre><code>Module '&quot;react-native-vector-icons&quot;' has no exported member 'MaterialCommunityIcons'.ts(2305)
  </code></pre>
  <p>Here is my package.json file if that helps:</p>
  <pre><code>{
    &quot;name&quot;: &quot;frontend&quot;,
    &quot;version&quot;: &quot;0.1.0&quot;,
    &quot;private&quot;: true,
    &quot;dependencies&quot;: {
      &quot;@emotion/react&quot;: &quot;^11.4.1&quot;,
      &quot;@emotion/styled&quot;: &quot;^11.3.0&quot;,
      &quot;@testing-library/jest-dom&quot;: &quot;^5.11.4&quot;,
      &quot;@testing-library/react&quot;: &quot;^11.1.0&quot;,
      &quot;@testing-library/user-event&quot;: &quot;^12.1.10&quot;,
      &quot;@types/history&quot;: &quot;2.0.45&quot;,
      &quot;@types/jest&quot;: &quot;^26.0.15&quot;,
      &quot;@types/node&quot;: &quot;^12.0.0&quot;,
      &quot;@types/react&quot;: &quot;^17.0.0&quot;,
      &quot;@types/react-dom&quot;: &quot;^17.0.0&quot;,
      &quot;@types/react-router&quot;: &quot;3&quot;,
      &quot;@types/react-router-dom&quot;: &quot;^5.1.8&quot;,
      &quot;community&quot;: &quot;^0.0.1&quot;,
      &quot;eslint-config-prettier&quot;: &quot;^8.3.0&quot;,
      &quot;eslint-plugin-prettier&quot;: &quot;^3.4.0&quot;,
      &quot;history&quot;: &quot;^5.0.1&quot;,
      &quot;icons&quot;: &quot;^1.0.0&quot;,
      &quot;material&quot;: &quot;^0.4.3&quot;,
      &quot;prettier&quot;: &quot;^2.3.2&quot;,
      &quot;react&quot;: &quot;^17.0.1&quot;,
      &quot;react-bootstrap&quot;: &quot;^1.6.1&quot;,
      &quot;react-dom&quot;: &quot;^17.0.1&quot;,
      &quot;react-native-vector-icons&quot;: &quot;^8.1.0&quot;,
      &quot;react-router-dom&quot;: &quot;^5.2.0&quot;,
      &quot;react-scripts&quot;: &quot;4.0.1&quot;,
      &quot;react-vector-icons&quot;: &quot;^0.0.1&quot;,
      &quot;typescript&quot;: &quot;^4.1.2&quot;,
      &quot;web-vitals&quot;: &quot;^1.0.1&quot;
    },
  </code></pre>
  <p>What can I do to fix this issue when it comes up? I'm not exactly asking about these 3 particular issues, but how to solve the <code>Module has no exported member .ts(2305)</code> error because it seems to come up often.</p>
  <p>What I have read a couple times and have tried to do is install the type definitions (I think?) like this:</p>
  <p><code>yarn add @types/react-router-dom</code> and <code>yarn add @types/react-router</code> and finally <code>yarn add @types/react-native-vector-icons</code> and trying simply <code>yarn install</code> but this has never solved the problem.</p>