diff --git a/src/Get.tsx b/src/Get.tsx index ee403c70..0564155f 100644 --- a/src/Get.tsx +++ b/src/Get.tsx @@ -80,10 +80,6 @@ export interface GetComponentProps { base?: string; } -interface GetComponentDefaultProps { - resolve: ResolveFunction; -} - /** * State for the component. These * are implementation details and should be @@ -96,8 +92,6 @@ export interface GetComponentState { loading: boolean; } -type PropsWithDefaults = GetComponentProps & GetComponentDefaultProps; - /** * The component without Context. This * is a named class because it is useful in @@ -111,7 +105,7 @@ class ContextlessGet extends React.Component, Readonly = { + public static defaultProps: Partial> = { resolve: (unresolvedData: any) => unresolvedData, }; @@ -161,7 +155,7 @@ class ContextlessGet extends React.Component, Readonly { - const { base, path, resolve } = this.props as PropsWithDefaults; + const { base, path, resolve } = this.props; this.setState(() => ({ error: "", loading: true })); const request = new Request(`${base}${requestPath || path || ""}`, this.getRequestOptions(thisRequestOptions)); @@ -175,7 +169,7 @@ class ContextlessGet extends React.Component, Readonly