Skip to content

Commit a2fd571

Browse files
authored
Allow static methods on components
Having a static method (e.g. `fetchData`) to fetch just the data required to render a component on the server is a standard practice for universal apps. `renderProps: Object` as currently declared doesn't allow the static method, because `Object` doesn't have them. Declaring it as any will fix this problem.
1 parent a0a0545 commit a2fd571

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

react-router.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ declare module ReactRouter {
748748
* @param {routes: RouteConfig}
749749
* @param {(error:Error, redirectLocation:Location, renderProps : Object) => void} callback
750750
*/
751-
export function match({routes: RouteConfig}, callback: (error: Error, redirectLocation: Location, renderProps: Object) => void): void;
751+
export function match({routes: RouteConfig}, callback: (error: Error, redirectLocation: Location, renderProps: any) => void): void;
752752

753753
/**
754754
* Creates and returns an array of routes from the given object which may be a JSX route, a plain object route, or an array of either.

0 commit comments

Comments
 (0)