I have a simple TypeScript Component where I try to implement type checking, but I cannot figure out what is wrong with the next part of code:
import React from 'react'
import { Provider } from 'react-redux'
import { Title } from '../components'
import { Props } from './types'
const AppContainer: React.SFC<Props> = ({ store }) => {
return (
<Provider store={store}>
<Title />
</Provider>
)
}
export default AppContainer
Because I always gets an error:
TS2322: Type 'object' is not assignable to type 'Store'. Property 'dispatch' is missing in type '{}'.
Component Interface:
export interface Props {
store: object,
dispatch(): any,
getState(): any,
subscribe(): any,
replaceReducer(): any
}
P.S.
I admit, that Type checking works fine if I remove bracers from the argument store
, like:
const AppContainer: React.SFC<Props> = (store) => ...