UNPKG

@shopify/react-server

Version:
15 lines (14 loc) 646 B
import React from 'react'; import { Context } from 'koa'; import { ArgumentAtIndex } from '@shopify/useful-types'; import { extract } from '@shopify/react-effect/server'; export { Context }; export interface RenderFunction { (ctx: Context): React.ReactElement<any>; } declare type Options = Pick<NonNullable<ArgumentAtIndex<typeof extract, 1>>, 'afterEachPass' | 'betweenEachPass'>; /** * Creates a Koa middleware for rendering an `@shopify/react-html` based React application defined by `options.render`. * @param render */ export declare function createRender(render: RenderFunction, options?: Options): (ctx: Context) => Promise<void>;