title: Calling functions inside a axios function definition in react.js laravel combination project
body: <p>I configured my project using npm install,npm intstall axios,npm install sweetalert-react,npm install react react-dom redux react-redux --save,npm install react-redux-form@latest --save commands.I am trying to implement a axios functionality.My problem is i can't call another member function from axios function definition in laravel-react combination.js.Also i found that this.setState not working inside axios function definition.I spent moretime time to find a solution.One post i found is solution relates to jsfiddle method in stackoverflow.But it is not working in my project.I found functions are not called by sweetalert not working as it's show property not changed in side functions.
  This is my jsx file.</p>
  
  <pre><code>import React, { Component } from 'react';
  import ReactDOM from 'react-dom';
  import { LocalForm, Control } from 'react-redux-form';
  import SweetAlert from 'sweetalert-react';
  import 'sweetalert/dist/sweetalert.css';
  import axios from 'axios';
  export default class MyApp extends React.Component {
      constructor(props)
      {
         super(props);
         this.state={ show:false,message:''}   
      }
  
    handleChange(values) {  }
    handleUpdate(form) {  }
    handleSubmit(values) { 
  
      axios.post('/log-in/',{
          username:'username',
          password:'password'
      }).then(function(response)
      {
  
          this.display(response.data);
      }).catch(function(error)
      {
          this.display(error);    
      });
       display(data)
     {
        this.setState({ message:data});
        this.setState({ show:true})
     }    
     }
    render() {
      return (
          &lt;div id="log-in"&gt;
          &lt;h3 className="hh"&gt;&lt;b&gt;Log In&lt;/b&gt;&lt;/h3&gt;
        &lt;LocalForm
          onUpdate={(form) =&gt; this.handleUpdate(form)}
          onChange={(values) =&gt; this.handleChange(values)}
          onSubmit={(values) =&gt; this.handleSubmit(values)}
        &gt;
          &lt;div className="form-control-area"&gt;
          &lt;label className="form-label"&gt;USERNAME&lt;/label&gt;
          &lt;Control.text model=".username" className="form-control" /&gt;
          &lt;/div&gt;
          &lt;div className="form-control-area"&gt;
          &lt;label className="form-label"&gt;PASSWORD&lt;/label&gt;
          &lt;Control type="password"  model=".password" className="form-control"/&gt;
          &lt;/div&gt;
          &lt;div className="form-control-area"&gt;
          &lt;table&gt;&lt;tr&gt;
          &lt;td&gt;
          &lt;Control type="submit"  model=".Submit" className="form-submit"/&gt;
          &lt;/td&gt;
          &lt;td&gt;
          &lt;Control type="reset"  value="Cancel" model=".Cancel" className="form-reset"/&gt;
          &lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
          &lt;/div&gt;
        &lt;/LocalForm&gt;&lt;SweetAlert 
          show={this.state.show}
          title="Sorry"
          text={this.state.message}
          onConfirm={() =&gt; this.setState({ show: false })}
        /&gt;&lt;/div&gt;
      );
    }
  }
  
  if (document.getElementById('example')) {
      ReactDOM.render(&lt;Example /&gt;, document.getElementById('example'));
  }
  if(document.getElementById('start'))
  {
    ReactDOM.render(&lt;MyApp /&gt;,document.getElementById('start'));
  }
  </code></pre>
  
  <p>it is my blade file</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="{{ app()-&gt;getLocale() }}"&gt;
  &lt;head&gt;
      &lt;title&gt;Demo|Log In&lt;/title&gt;
      &lt;link rel="stylesheet" href="{{ asset('css/app.css') }}"&gt;
      &lt;link rel="stylesheet" href="{{ asset('css/login.css') }}"&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;div id="start"&gt;&lt;/div&gt;
          &lt;div id="alert"&gt;&lt;/div&gt;
          &lt;script src="{{ asset('js/app.js') }}"&gt;&lt;/script&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please help me to fix this bug</p>