///
/** HOC to cache a props value and pass a transformed value to the child.
* When the input value changes, transform it and pass it along. If no
* transform is specified, then pass it through directly. All other props
* are passed through. Transforms are asynchronous. Essentially, this allows
* you to cache some data as state passed through props but is expensive to obtain.
*/
import * as React from "react";
export interface Prop {
/** Data that when changed should trigger a fetch. */
value?: I | null;
/** Transform the data. */
transform?: (value: I) => Promise;
/** Data is added to the props of child using childProp name. */
propName?: string;
/** Provide a default value if value is empty. Typically () => ""|0|{}. */
emptyValue?: () => O;
/** Initial value. */
initialValue?: I;
}
export interface State {
value?: I;
loading: boolean;
error?: Error;
}
export declare class FetchDataComponent extends React.Component, State> {
constructor(props: any, context: any);
shouldComponentUpdate(nextProps: any, nextState: any): boolean;
componentWillReceiveProps(nextProps: any): void;
render(): React.ReactElement | null;
}