SSRProvider
When using SSR with React Aria, applications must be wrapped in an SSRProvider. This ensures that auto generated ids are consistent between the client and server.
install | yarn add @react-aria/ssr |
---|---|
version | 3.1.2 |
usage | import {SSRProvider} from '@react-aria/ssr' |
Introduction#
SSRProvider
should be used as a wrapper for the entire application during server side rendering.
It works together with the useId hook to ensure that auto generated ids are consistent
between the client and server by resetting the id internal counter on each request.
See the server side rendering docs for more information.
Props#
Name | Type | Default | Description |
children | ReactNode | — | Your application here. |
Example#
import {SSRProvider} from '@react-aria/ssr';
<SSRProvider>
<YourApp />
</SSRProvider>
import {SSRProvider} from '@react-aria/ssr';
<SSRProvider>
<YourApp />
</SSRProvider>
import {SSRProvider} from '@react-aria/ssr';
<SSRProvider>
<YourApp />
</SSRProvider>