Closed bezreyhan closed 8 years ago
This is not a bug. The reason for this error was that I was not providing an interface for context. Adding this to my component class fixed the issue:
context: IContext
static contextTypes = { router: React.PropTypes.func.isRequired } where IContext is:
interface IContext { router: { goBack: { (): void } }; }
I have a class
PageHeader
that uses withRouter like so:However, I get the following error:
TS2324: Property 'router' is missing in type 'IntrinsicAttributes & IntrinsicClassAttributes<PageHeader> & IProps & { children?: {} | undefined...'.