Skip to main content

ssr

Description: If false, the action will only be executed on the client.

Default Value: false.

  • How To: Set ssr: false for data that is only relevant or can only be fetched on the client-side (e.g., data from browser-specific APIs, or user-specific data that should not be exposed during SSR).
    // Correct: Fetch geolocation data only on the client
    useFetch(
    'geolocation',
    fetchGeolocation,
    { ssr: false } // This data is only available in the browser
    );
  • Best Practice: Avoid setting ssr: false for critical data that should be pre-fetched on the server for better initial load performance and SEO. Disabling SSR for such data will result in a blank state until the client-side fetch completes.