Ao configurar Redux DevTools obtenho o seguinte erro do TypeScript:
Property 'REDUX_DEVTOOLS_EXTENSION_COMPOSE' does not exist on type 'Window & typeof globalThis'.
store.ts
import { applyMiddleware, createStore, Store } from 'redux';
import createSagaMiddleware from 'redux-saga';
import { DevsState } from './ducks/devs/types';
import rootReducer from './ducks/rootReducer';
import rootSaga from './ducks/rootSaga';
export interface ApplicationState {
devs: DevsState
}
const composeEnhancers =
typeof window === 'object' &&
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
// Specify extension’s options like name, actionsBlacklist, actionsCreators, serialize...
}) : compose;
const sagaMiddleware = createSagaMiddleware();
const enhancer = composeEnhancers(
applyMiddleware(sagaMiddleware),
);
const store: Store<ApplicationState> = createStore(rootReducer, enhancer);
sagaMiddleware.run(rootSaga);
export default store;
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
tentewindow['__REDUX_DEVTOOLS_EXTENSION_COMPOSE__']
. Suspeito de uma situação (que ocorre no pré-parse do ts)