title: React TypeScript - passing a callback function
body: <p>The following code would have worked happily in JavaScript. I am using React+TypeScript, hence this is a JSX file:</p>
  
  <p>Calling component:</p>
  
  <pre><code>&lt;FiltersPanel onFiltersChanged={() =&gt; { console.log('I was called') }} /&gt;
  </code></pre>
  
  <p>Inner Component:</p>
  
  <pre><code>const FiltersPanel = (onFiltersChanged) =&gt; {
  
      const handleFiltersChange = () =&gt; {
          onFiltersChanged(); /* I am getting `TypeError: onFiltersChanged is not a function` */
      };
  
      return (&lt;div onClick={handleFiltersChange}/&gt; );
  };
  
  export default FiltersPanel;
  </code></pre>
  
  <p>Why is TypeScript complaining that it cannot find the function, while the function is certainly passed as a prop.</p>