title: i am passing parameter from one function to another function in reactJs but result is coming null
body: <p>This is my first file with function 1 </p>
  
  <pre><code>import React, {Component} from "react";
  import axios from 'axios';
  import { config } from '../../config/config.js';
  class Dashboard extends Component {
    constructor(props) {
      super(props);
    }
    componentWillMount(){
        var obj = {
            campaign:campaignName,
            campaignId:campaignId,
            clientId:clientId,
            clientName:clentName,
            end:endDate,
            start:startDate,
            timeZone:new Date().getTimezoneOffset(),
            ReportName:'Chargebacks',
            widgetName:'Billing Cycle'
      }
       var resdata = ChartAPI.widgetApiCalls(config.apiUrl,obj);
       console.log(resdata );
    }
  }
  </code></pre>
  
  <p>And this is another one with function 2</p>
  
  <pre><code>import axios from 'axios';
   function charts(){
       this.widgetApiCalls =  function(url,parmsobj){
          var byresspose=[];
          axios.get(url+"/reports",{params:parmsobj})
            .then(function(response){        
                  for(var i in response.data){
                      byresspose.push({"label":"Billing Cycle"+" "+response.data[i].billingCycle,"value":response.data[i].total})
                  }
                  console.log(byresspose);
            });
            return  byresspose;
        };
   }
  charts = new charts();
  module.exports = charts; 
  </code></pre>
  
  <p>What is the correct way to pass parameter from one function 1 to another function 2?</p>