title: how to add type declaration to react-typescript project with CRA
body: <p>I have created a react typescript project with CRA with the command <code>yarn create react-app my-app --typescript</code></p>
  
  <p>now I have a module <code>foo</code> installed that does not have any typing not by default, not in defentlytyped repository.</p>
  
  <p>i.e. in a component, I have </p>
  
  <pre><code>import {bar} from 'foo';
  </code></pre>
  
  <p>which throws error <code>Type error: Could not find a declaration file for module 'foo'. '/*/node_modules/foo/dist/entry.js' implicitly has an 'any' type.</code></p>
  
  <p>I created <code>foo.d.ts</code> in types folder at the root of the project like</p>
  
  <pre><code>declare module 'foo'{ import * as React from 'react' }
  </code></pre>
  
  <p>just to have the <code>foo</code> as type <code>any</code> but still, get the same error. it seems that whatever compiler (webpack,other transpiler) does not find the declaration at <code>types</code> folder </p>
  
  <p>how can I add custom type declaration to the project?</p>