title: non-component class in react
body: <p>Can I define a non-Component class in react.
  I'm trying to define a class for managing api request but I can't configure fields (I'm getting an undefined error on BaseUrl value)</p>
  
  <pre><code>class fetchFromAPI {
  
    constructor(){       
      //super();
      this.BaseURL = "myUrlvalue";
    }
    fetchConfig (payload){
      return  {
        method: 'POST',
        body: JSON.stringify(payload),
        mode: 'cors',
        headers: {
          'Accept': 'application/json',
          'Content-Type': 'application/json',
        }          
      };
    }
    fetchUse (/*componentThis,*/command,options){
          var fullUrl = this.BaseURL+command;
          return fetch(fullUrl, this.fetchConfig(options));
    }    
    fetchResponse (data,onSucessFunc,onSucessJson,onFailureFunc,onFailureJson){
      if(data.response==1){
          onSucessFunc(data,onSucessJson);   
      }
      else{
          onFailureFunc(data,onFailureJson);
      }
    }
  }
  export default fetchFromAPI;
  </code></pre>
  
  <p>The way I use the class</p>
  
  <pre><code>class App extends React.Component{
    constructor(props){
      super(props);
      const payload = {
          sender: "senderId"
        };
      var myAPI = new fetchFromAPI();
      var myRequest = myAPI.fetchConfig(payload); 
      var response = myAPI.fetchUse("api_command",myRequest);        
  
    }
    render(){
       return (&lt;div&gt;&lt;/div&gt;);
    }
  }
  </code></pre>