I'm trying to build react app with typescript using redux for state management but I'm getting this error on the app component.
-app.tsx
import React from 'react';
import { Provider } from 'react-redux';
//import { Router } from "react-router";
import store from './redux/store';
import './App.css';
function App() {
return (
<Provider store={store}>
</Provider>
);
}
export default App;
-Store.tsx
import { createStore, applyMiddleware, compose } from 'redux';
import { createLogger } from 'redux-logger';
import thunk from 'redux-thunk';
import rootReducer from './reducers';
const loggerMiddleware = createLogger()
// For redux DevTool
declare global {
interface Window {
__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?: typeof compose;
}
}
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const enhancer = composeEnhancers(
applyMiddleware(thunk, loggerMiddleware)
);
const initialState = {};
const store = createStore(rootReducer, initialState, enhancer);
export default store;
I tried to inject the store in the index but i have the same error with.. Any idea where the issues came from??