React Use API
  • Introduction
  • Usage
    • Getting Started
    • Advanced Usage
      • List API and Pagination
      • Request Control
      • Data Processing
      • Side-Effect Dependencies
      • Watch option
    • TypeScript
  • API
    • useApi
    • State
    • Request Function
    • ApiProvider
    • injectSSRHtml
    • loadApiCache
  • Server Side Rendering
    • SSR Settings
    • Examples
      • Real World Examples
      • With Ant Design
Powered by GitBook
On this page

Was this helpful?

  1. API

injectSSRHtml

PreviousApiProviderNextloadApiCache

Last updated 5 years ago

Was this helpful?

Arguments of injectSSRHtml

injectSSRHtml(
  context: ReactUseApi.CustomContext,
  renderSSR?: () => string
  postProcess?: (ssrHtml: string, apiCacheScript: string) => string,
): string

You are able to customize the html returned from injectSSRHtml by postProcess. By default, injectSSRHtml returns ssrHtml + apiCacheScript.

Please refer to for more details regarding context.

here