SSRProvider

When using SSR with React Aria in React 16 or 17, applications must be wrapped in an SSRProvider. This ensures that auto generated ids are consistent between the client and server.

import {SSRProvider} from '@react-aria/ssr';

<SSRProvider>
  <YourApp />
</SSRProvider>

Introduction

If you're using React 16 or 17, 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.

API

SSRProvider

NameType
childrenReactNode
Your application here.