title: REACT - Error: Attempted import error/ App' does not contain a default export (imported as 'App'
body: <p>Returns an error: ./src/index.js
  Attempted import error: './App' does not contain a default export (imported as 'App').</p>
  
  <pre><code>import React, { Component, useState } from "react";
  
  const App = () =&gt; {
      const [count, setCount] = useState(0);
  
    const  increment = () =&gt; {
          setCount(count + 1);
      };
  
      return (
        &lt;div&gt;
            &lt;h2&gt; counter app &lt;/h2&gt;
            &lt;button onClick={increment}&gt;Clicked {count} times&lt;/button&gt;
        &lt;/div&gt;
      );
  };
  </code></pre>
  
  <p><strong>index</strong></p>
  
  <pre><code>import React from 'react';
  import ReactDOM from 'react-dom';
  import App from './App';
  
  
  ReactDOM.render(&lt;App /&gt;, document.getElementById('root'));
  </code></pre>