This repository was archived by the owner on Feb 14, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 87
Typescript: Incorrect types on class ComponentΒ #98
Copy link
Copy link
Open
Labels
help wantedThe owner cannot resolve this on their own.The owner cannot resolve this on their own.more info neededThe issue requires more information.The issue requires more information.supportA user is requesting support.A user is requesting support.
Description
"react": "^16.8.1",
"reactn": "^2.1.4",
When using reactn as: import React, { Component } from 'reactn'
TypeScript fails with the following:
Class static side 'typeof Form' incorrectly extends base class static side '{ propTypes?: WeakValidationMap<{}> | undefined; contextType?: Context<any> | undefined; contextTypes?: ValidationMap<any> | undefined; childContextTypes?: ValidationMap<any> | undefined; defaultProps?: Partial<...> | undefined; displayName?: string | undefined; getDerivedStateFromProps?: GetDerivedStateFromProps<.....'.
Type 'typeof Form' is not assignable to type '{ propTypes?: WeakValidationMap<{}> | undefined; contextType?: Context<any> | undefined; contextTypes?: ValidationMap<any> | undefined; childContextTypes?: ValidationMap<any> | undefined; defaultProps?: Partial<...> | undefined; displayName?: string | undefined; getDerivedStateFromProps?: GetDerivedStateFromProps<.....'.
Types of property 'getDerivedStateFromProps' are incompatible.
Type '(nextProps: Props, prevState: State) => { prevPath: string; } | null' is not assignable to type 'GetDerivedStateFromProps<{}, {}>'.
Types of parameters 'nextProps' and 'nextProps' are incompatible.
Type 'Readonly<{}>' is not assignable to type 'Props'.
Type 'Readonly<{}>' is missing the following properties from type 'RouteComponentProps<RouteParams, StaticContext, any>': history, location, match TS2417
54 | }
55 |
> 56 | class Form extends Component<Props, State> {
| ^
57 | constructor(props: Props) {
58 | super(props)
59 |
@CharlesStover, do you have any idea why? Any help would be appreciated
Numbers11
Metadata
Metadata
Assignees
Labels
help wantedThe owner cannot resolve this on their own.The owner cannot resolve this on their own.more info neededThe issue requires more information.The issue requires more information.supportA user is requesting support.A user is requesting support.