fix: wrap SSR app with EncryptionKeyProvider
The EncryptionKeyProvider was missing from the SSR entry point, causing 'useEncryptionKey must be used within an EncryptionKeyProvider' error when server-side rendering pages that use EncryptedText.
This commit is contained in:
parent
413f83f961
commit
770f091b9b
|
|
@ -2,6 +2,7 @@ import { createInertiaApp } from '@inertiajs/react';
|
|||
import createServer from '@inertiajs/react/server';
|
||||
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
|
||||
import ReactDOMServer from 'react-dom/server';
|
||||
import { EncryptionKeyProvider } from './contexts/encryption-key-context';
|
||||
|
||||
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
|
||||
|
||||
|
|
@ -16,7 +17,11 @@ createServer((page) =>
|
|||
import.meta.glob('./pages/**/*.tsx'),
|
||||
),
|
||||
setup: ({ App, props }) => {
|
||||
return <App {...props} />;
|
||||
return (
|
||||
<EncryptionKeyProvider>
|
||||
<App {...props} />
|
||||
</EncryptionKeyProvider>
|
||||
);
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
|
|
|||
Loading…
Reference in New Issue