react-redux-isomorphic
Version:
Set of utilities for creating isomorphic applications using react-redux
11 lines (10 loc) • 868 B
TypeScript
import type { ComponentType } from 'react';
import type { ContextResolverProps } from './IsomorphicWrapper';
import type { DefaultLoadParams } from './types';
export declare type IsomorphicParams<BaseProps, IsomorphicContext, LoadParams = DefaultLoadParams> = {
isomorphicId?: string;
getContext: (loadParams: LoadParams, baseProps: BaseProps) => IsomorphicContext | Promise<IsomorphicContext>;
shouldReload?: (prevProps: BaseProps, nextProps: BaseProps) => boolean;
};
declare const isomorphic: <BaseProps, IsomorphicContext, IsomorphicError = Error, LoadParams = DefaultLoadParams>({ isomorphicId, getContext, shouldReload, }: IsomorphicParams<BaseProps, IsomorphicContext, LoadParams>) => (component: ComponentType<ContextResolverProps<BaseProps, IsomorphicContext, IsomorphicError, LoadParams>>) => ComponentType<BaseProps>;
export default isomorphic;