title: In React get SyntaxError : Unexpected token
body: <p>I am a beginner in react</p>
  <p>in this code create class component and use useState but not working</p>
  <p>i can't fount what i missing</p>
  <p>Please help.</p>
  <p><a href="https://i.stack.imgur.com/8eLBt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8eLBt.png" alt="enter image description here" /></a></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>class ModuleDialog extends Component {
  
    constructor(props) {
      super(props);
      //this.state = {open: false};
    };
  
    //const [open, setOpen] = useState({false});
    const [tasks, setTasks] = useState([]);
  
    handleClickOpen = () =&gt; {
      //setOpen(true);
      this.state = {open: true};
    };
    handleClose = () =&gt; {
      //setOpen(false);
      this.state = {open: false};
    };
    
    render() {
      
      return (
        &lt;div&gt;
        ......
      &lt;/div&gt;
      );
    }
  }</code></pre>
  </div>
  </div>
  </p>