title: How can I pass an Axios instance as an object or prop into a React component?
body: <p>I have a component that I want to reuse with different Axios clients.</p>
  <p>Example:</p>
  <pre><code>var first_instance = axios.create({
    baseURL: 'https://bank_one.com/api'
  });
  var second_instance = axios.create({
    baseURL: 'https://bank_two.com/api'
  });
  
  const clients = {
    first_instance,
    second_instance
  };
  
  export default clients;
  </code></pre>
  <p>I have a component and I want to be able to pass one of these instances as a prop or object. Something like this:</p>
  <pre><code>function BankClient({clients}){
  
  
    handleSubmit = event =&gt; {
      event.preventDefault();
  
    const user = {
      name: this.state.name
    };
  
    clients.first_instance.get(`/accounts`, { user })
     .then(res =&gt; {
       console.log(res);
       console.log(res.data);
     })
   }
    
    return(
      //etc etc
    )
  }
  </code></pre>
  <p>I've tried using <a href="https://bobbyhadz.com/blog/react-pass-object-as-props" rel="nofollow noreferrer">this blog</a> to pass objects as props but it doesn't seem to be working</p>