found-relay
Version:
Relay integration for found
38 lines (37 loc) • 1.25 kB
TypeScript
import type { Match } from 'found';
import React from 'react';
import type { Disposable } from 'relay-runtime';
import QuerySubscription from './QuerySubscription';
declare type RouteElement = React.ReactElement | ((routes: React.ReactElement | {}) => React.ReactElement);
interface Props {
match: Match & {
route: Record<string, any>;
};
Component: React.ElementType | null;
isComponentResolved: boolean;
hasComponent: boolean;
element: RouteElement;
routeChildren: React.ReactElement | {};
querySubscription: QuerySubscription;
fetched: boolean;
[other: string]: any;
}
interface State {
isInitialRender: true;
element: RouteElement;
propsElement: RouteElement;
querySubscription: QuerySubscription;
selectionReference: Disposable;
onUpdate: () => void;
}
declare class ReadyStateRenderer extends React.Component<Props, State> {
constructor(props: Props);
componentDidMount(): void;
static getDerivedStateFromProps({ element, querySubscription }: Props, state: State): Partial<State> | {
isInitialRender: boolean;
} | null;
componentWillUnmount(): void;
onUpdate: () => void;
render(): JSX.Element;
}
export default ReadyStateRenderer;