0xfuje / redux-typescript-practice

Using React with Redux and Typescript
0 stars 0 forks source link

Can't setup store in React Redux Provider #1

Open 0xfuje opened 2 years ago

0xfuje commented 2 years ago

Error reads as: No overload matches this call. Overload 1 of 2, '(props: ProviderProps | Readonly<ProviderProps>): Provider', gave the following error. Type 'typeof import("c:/Users/Fuje/Desktop/2022-practice/redux-typescript-with-laith_harb/src/state/store")' is missing the following properties from type 'Store<any, AnyAction>': dispatch, getState, subscribe, replaceReducer, [Symbol.observable]

mbukeRepo commented 2 years ago

I solved this problem like this

const App = () => (
  const providerProps = {store};
  <Provider {...providerProps}>
    <ToastProvider position="BOTTOM">
      <StatusBar backgroundColor="#000" />
      <Routes />
    </ToastProvider>
  </Provider>
);