I am coverting my react code to typescript and using axios for network call. On running in IE11 i get error "Promise is not defined"
I know i need to use polyfill but how? I am not using Babel and Webpack.
I used babel-polyfill.js and error goes away but I get this ERROR
Uncaught Sys.ParameterCountException: Sys.ParameterCountException: Parameter count mismatch.
Any idea how could i do it?
tsconfig.json
{
"compilerOptions": {
"module": "UMD",
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true,
"jsx": "react",
"lib": ["DOM","ES6","DOM.Iterable","ScriptHost"],
"typeRoots": []
},
"include": [
"*.tsx"
],
"exclude": [
"node_modules"
]
}
abc.tsx
import axios = require('../../Scripts/axios');
import * as React from 'react';
import * as ReactDOM from 'react-dom';
class abc extends React.Component<Props, state> {
function renderabc(res){
ReactDOM.render(
<abc resources={res}/>,
document.getElementById('abc_React')
);
}
export abc;
results expected: axios to work on IE11
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.