issue with axios unhandled promise internet explorer

拥有回忆 提交于 2019-12-08 11:20:59

问题


I am using React with axios and experiencing difficulties with IE11+ and seeing the following error:

Unhandled promise rejection TypeError: Unable to get property 'getHostNode' of undefined or null reference.

Everything works fine in Chrome, Safari and Firefox.

export const getData = () => {
    return axios.get('data.json');
};

I then use this above call in a redux action

export const getAllData = () => {
    return dispatch => {
        api.getData().then(resp => {
            dispatch(getDataSuccess(resp.data));
            resolve(resp);
        }).catch(err => {
            dispatch(getDataError(err));
            reject(err);
        });
    };
};

Finally I call this action in my react component

......

componentWillMount() {
   this.props.getAllData();
}

.....

来源:https://stackoverflow.com/questions/45978423/issue-with-axios-unhandled-promise-internet-explorer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!