title: Property 'data' does not exist on type 'AxiosResponse<any> | undefined'
body: <p>My action which is throwing the error:</p>
  
  <pre><code>// ACTIONS
  export const startGetPrices = () =&gt; (dispatch: any) =&gt; getLatest().then((res) =&gt; {
    console.log('res', res);
    const { data } = res; // &lt;-- error highlighted data
    const { rates } = data;
    dispatch(actionGetPrices(rates));
  });
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/5ZrOg.png" rel="noreferrer"><img src="https://i.stack.imgur.com/5ZrOg.png" alt="enter image description here"></a></p>
  
  <p>In the same file I have the following interfaces:</p>
  
  <pre><code>export interface IPricesRes {
    data: IPriceData
  }
  
  export interface IPriceData {
    base: string;
    date: string;
    rates: any;
    success: boolean;
    timestamp: number;
  }
  </code></pre>
  
  <p>And in my component where I'm using that interface:</p>
  
  <pre><code>import React from 'react'
  import { connect } from 'react-redux'
  
  import { startGetPrices, IPricesRes } from '../store'
  import { CurrencySelector, Header, Prices, Navigation } from '../components'
  
  interface IProps {
    fiatPrices: [];
    startGetPrices(): IPricesRes; // &lt;-- the res interface
  }
  
  class FiatWallet extends React.PureComponent&lt;IProps&gt; {
    componentDidMount() {
      console.log('FiatWallet componentDidMount...');
      this.props.startGetPrices();
    }
  
    public render() {
      const { fiatPrices } = this.props;
      return (
        &lt;section&gt;
          &lt;CurrencySelector /&gt;
          &lt;Header /&gt;
          &lt;Prices prices={fiatPrices} /&gt;
          &lt;Navigation /&gt;
        &lt;/section&gt;
      );
    }     
  }
  
  const mapDispatchToProps = (dispatch: any) =&gt; ({
    startGetPrices: () =&gt; dispatch(startGetPrices())
  });
  
  const mapStateToProps = (state: any) =&gt; ({
    fiatPrices: state.fiatPrices,
    wallets: state.fiatPrices,
    defaultCurrency: state.defaultCurrency
  });
  
  export const BoardJest = FiatWallet;
  
  export default connect(mapStateToProps, mapDispatchToProps)(FiatWallet);
  </code></pre>
  
  <p>It's telling me data doesn't exist on type <code>AxiosResponse&lt;any&gt;</code> and my question is how do I type it correctly?</p>
  
  <p>Where do I use <code>IPricesRes</code> and <code>IPriceData</code>?</p>
  
  <hr>
  
  <p>My entire store.ts file:</p>
  
  <pre><code>import { createStore, applyMiddleware } from 'redux'
  import { composeWithDevTools } from 'redux-devtools-extension'
  import thunkMiddleware from 'redux-thunk'
  
  import { getLatest } from './services/api'
  
  export interface IinitialState {
    fiatPrices: [];
    wallets: [];
    defaultCurrency: string;
  }
  
  export interface IPricesRes {
    data: IPriceData
  }
  
  export interface IPriceData {
    base: string;
    date: string;
    rates: any;
    success: boolean;
    timestamp: number;
  }
  
  const initialState = {
    fiatPrices: [],
    wallets: [],
    defaultCurrency: ''
  }
  
  // ACTION TYPES
  export const actionTypes = {
    GET_PRICES: 'GET_PRICES'
  }
  
  // REDUCER
  export const reducer = (state = initialState, action: any) =&gt; {
    switch (action.type) {
      case actionTypes.GET_PRICES: {
        const { rates } = action;
        return {
          ...state,
          fiatPrices: rates
        };
      }
  
      default:
        return state;
    }
  }
  
  // ACTIONS CREATORS
  export const actionGetPrices = (data: any) =&gt; ({
    type: actionTypes.GET_PRICES,
    assets: data
  });
  
  // ACTIONS
  export const startGetPrices = () =&gt; (dispatch) =&gt; getLatest().then((res) =&gt; {
    console.log('res', res);
    const { data } = res;
    const { rates } = data;
    dispatch(actionGetPrices(rates));
  });
  
  // @ts-ignore
  export function initializeStore(initialState: IinitialState = initialState) {
    return createStore(
      reducer,
      initialState,
      composeWithDevTools(applyMiddleware(thunkMiddleware))
    )
  }
  </code></pre>
  
  <p>services/api where <code>getLatests()</code> is:</p>
  
  <pre><code>import axios from 'axios'
  
  const fixerAPI = 'http://data.fixer.io/api/';
  const fixerKey = '25a1ad0f5f253du7131b68cd1...';
  
  export const getLatest = async () =&gt; {
    const fixer = axios.create({
      baseURL: fixerAPI,
      params: {
        // base: 'USD',
        access_key: fixerKey
      }
    });
  
    try {
      const prices = await fixer.get('latest');
      return prices;
    } catch (err) {
      console.error(err);
    }
  }
  </code></pre>