我在 index.tsx 上得到了这个错误。
类型“窗口”上不存在属性“ 延伸”。
这是我的 index.tsx 代码:
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import App from './App';
import './index.css';
import registerServiceWorker from './registerServiceWorker';
import { Provider } from 'react-redux';
import { createStore, compose, applyMiddleware } from 'redux';
import rootReducer from './store/reducers';
import thunk from 'redux-thunk';
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(rootReducer, composeEnhancers(
applyMiddleware(thunk)
));
ReactDOM.render( <Provider store={store}><App /></Provider>, document.getElementById('root'));
registerServiceWorker();
我已经安装了@types/npm install —— save-dev redux-devtools-扩展,现在使用 create-response-app-type 脚本。非常感谢您提前给我们的建议。