Class properties must be methods. Expected '(' but instead saw '=' : <p>I have a react app, and I have this code, but it looks like the fetchdata m ethod  is full of syntax errors, the first one shown on the title of the question.</p>

<p>Whats wrong with the method?</p>

<pre><code>import React, { Component } from 'react';

import { Row, Col } from 'antd';
import PageHeader from '../../components/utility/pageHeader';
import Box from '../../components/utility/box';
import LayoutWrapper from '../../components/utility/layoutWrapper.js';
import ContentHolder from '../../components/utility/contentHolder';
import basicStyle from '../../settings/basicStyle';
import IntlMessages from '../../components/utility/intlMessages';
import { adalApiFetch } from '../../adalConfig';

const data = {
  TenantId: this.this.state.tenantid,
  TenanrUrl: this.state.tenanturl,
  TenantPassword: this.state.tenantpassword 
};

const options = {
  method: 'post',
  data: data,
  config: {
    headers: {
      'Content-Type': 'multipart/form-data'
    }
  }
};

export default class extends Component {
  constructor(props) {
    super(props);
    this.state = {value: ''};
    this.handleChangeTenantUrl = this.handleChangeTenantUrl.bind(this);
    this.handleChangeTenantPassword = this.handleChangeTenantPassword.bind(this);
    this.handleChangeTenantId= this.handleChangeTenantId.bind(this);
    this.handleSubmit = this.handleSubmit.bind(this);
  }

  handleChangeTenantUrl(event){
    this.setState({tenanturl: event.target.value});
  }

  handleChangeTenantPassword(event){
    this.setState({tenantpassword: event.target.value});
  }

  handleChangeTenantId(event){
    this.setState({tenantid: event.target.value});
  }

  handleSubmit(event){
    alert('A name was submitted: ' + this.state.value);
    event.preventDefault();
    fetchData();
  }

  fetchData = () =&gt; {
    adalApiFetch(fetch, "/tenant", options)
      .then(response =&gt; response.json())
      .then(responseJson =&gt; {
        if (!this.isCancelled) {
          this.setState({ data: responseJson });
        }
      })
      .catch(error =&gt; {
        console.error(error);
      });
  };

  upload(e) {

      let data = new FormData();

      //Append files to form data
      let files = e.target.files;
      for (let i = 0; i &lt; files.length; i++) {
        data.append('files', files[i], files[i].name);
      }

      let d = {
        method: 'post',
        url: API_SERVER,
        data: data,
        config: {
          headers: {
            'Content-Type': 'multipart/form-data'
          },
        },
        onUploadProgress: (eve) =&gt; {
          let progress = utility.UploadProgress(eve);
          if (progress == 100) {
            console.log("Done");
          } else {
            console.log("Uploading...",progress);
          }
        },
      };
      let req = axios(d);

      return new Promise((resolve)=&gt;{
          req.then((res)=&gt;{
              return resolve(res.data);
          });
      });

  }

  render(){
    const { data } = this.state;
    const { rowStyle, colStyle, gutter } = basicStyle;

    return (
      &lt;div&gt;
        &lt;LayoutWrapper&gt;
        &lt;PageHeader&gt;{&lt;IntlMessages id="pageTitles.TenantAdministration" /&gt;}&lt;/PageHeader&gt;
        &lt;Row style={rowStyle} gutter={gutter} justify="start"&gt;
          &lt;Col md={12} sm={12} xs={24} style={colStyle}&gt;
            &lt;Box
              title={&lt;IntlMessages id="pageTitles.TenantAdministration" /&gt;}
              subtitle={&lt;IntlMessages id="pageTitles.TenantAdministration" /&gt;}
            &gt;
              &lt;ContentHolder&gt;
              &lt;form onSubmit={this.handleSubmit}&gt;
                &lt;label&gt;
                  TenantId:
                  &lt;input type="text" value={this.state.tenantid} onChange={this.handleChangeTenantId} /&gt;
                &lt;/label&gt;
                &lt;label&gt;
                  TenantUrl:
                  &lt;input type="text" value={this.state.tenanturl} onChange={this.handleChangeTenantUrl} /&gt;
                &lt;/label&gt;
                &lt;label&gt;
                  TenantPassword:
                  &lt;input type="text" value={this.state.tenantpassword} onChange={this.handleChangeTenantPassword} /&gt;
                &lt;/label&gt;
                &lt;label&gt;
                  Certificate:
                  &lt;input onChange = { e =&gt; this.upload(e) } type = "file" id = "files" ref = { file =&gt; this.fileUpload } /&gt;
                 &lt;/label&gt;             
              &lt;input type="submit" value="Submit" /&gt;
              &lt;/form&gt;
              &lt;/ContentHolder&gt;
            &lt;/Box&gt;
          &lt;/Col&gt;
        &lt;/Row&gt;
      &lt;/LayoutWrapper&gt;
      &lt;/div&gt;
    );
  }
}
</code></pre>
