mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-04 12:11:47 +00:00
Default props should be {}, not undefined or void
This commit is contained in:
Vendored
+1
-1
@@ -14,7 +14,7 @@ export interface RouteConfigComponentProps<T> extends RouteComponentProps<T> {
|
||||
|
||||
export interface RouteConfig {
|
||||
location?: Location;
|
||||
component?: React.ComponentType<RouteConfigComponentProps<any> | void>;
|
||||
component?: React.ComponentType<RouteConfigComponentProps<any> | {}>;
|
||||
path?: string;
|
||||
exact?: boolean;
|
||||
strict?: boolean;
|
||||
|
||||
Vendored
+1
-1
@@ -64,7 +64,7 @@ export interface RouteComponentProps<P> {
|
||||
|
||||
export interface RouteProps {
|
||||
location?: H.Location;
|
||||
component?: React.ComponentType<RouteComponentProps<any> | undefined>;
|
||||
component?: React.ComponentType<RouteComponentProps<any> | {}>;
|
||||
render?: ((props: RouteComponentProps<any>) => React.ReactNode);
|
||||
children?: ((props: RouteComponentProps<any>) => React.ReactNode) | React.ReactNode;
|
||||
path?: string;
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const PreventingTransitionsExample = () => (
|
||||
</Router>
|
||||
);
|
||||
|
||||
class Form extends React.Component<undefined, {isBlocking: boolean}> {
|
||||
class Form extends React.Component<{}, {isBlocking: boolean}> {
|
||||
state = {
|
||||
isBlocking: false
|
||||
};
|
||||
|
||||
Vendored
+2
-2
@@ -24,8 +24,8 @@ export interface WithScrollOptions {
|
||||
|
||||
export type ComponentConstructor<Props> = React.ComponentType<Props>;
|
||||
|
||||
export function withScroll(component: ComponentConstructor<RouteComponentProps<any> | undefined>, options?: WithScrollOptions)
|
||||
: ComponentConstructor<RouteComponentProps<any> | undefined>;
|
||||
export function withScroll(component: ComponentConstructor<RouteComponentProps<any> | {}>, options?: WithScrollOptions)
|
||||
: ComponentConstructor<RouteComponentProps<any> | {}>;
|
||||
|
||||
export type RouteConfiguration = RouteProps & { inject?: { [key: string]: any } };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user