UNPKG

1.02 kBTypeScriptView Raw
1import * as React from 'react';
2
3export interface NoSsrProps {
4 /**
5 * You can wrap a node.
6 */
7 children?: React.ReactNode;
8 /**
9 * If `true`, the component will not only prevent server-side rendering.
10 * It will also defer the rendering of the children into a different screen frame.
11 */
12 defer?: boolean;
13 /**
14 * The fallback content to display.
15 */
16 fallback?: React.ReactNode;
17}
18
19/**
20 * NoSsr purposely removes components from the subject of Server Side Rendering (SSR).
21 *
22 * This component can be useful in a variety of situations:
23 *
24 * - Escape hatch for broken dependencies not supporting SSR.
25 * - Improve the time-to-first paint on the client by only rendering above the fold.
26 * - Reduce the rendering time on the server.
27 * - Under too heavy server load, you can turn on service degradation.
28 * Demos:
29 *
30 * - [No Ssr](https://mui.com/components/no-ssr/)
31 *
32 * API:
33 *
34 * - [NoSsr API](https://mui.com/api/no-ssr/)
35 */
36export default function NoSsr(props: NoSsrProps): JSX.Element;