Skip to content

Commit 8c0090a

Browse files
committed
1 parent cfba193 commit 8c0090a

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/next/pagesDir.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/ban-types */
12
import * as React from "react";
23
import type createEmotionServer_t from "@emotion/server/create-instance";
34
import type { DocumentContext } from "next/document";
@@ -17,8 +18,13 @@ export function createEmotionSsrAdvancedApproach(
1718
options: Omit<OptionsOfCreateCache, "insertionPoint"> & {
1819
prepend?: boolean;
1920
},
20-
/** By default <CacheProvider /> from 'import { CacheProvider } from "@emotion/react"' */
21-
CacheProvider: React.Provider<EmotionCache> = DefaultCacheProvider
21+
/**
22+
* By default <CacheProvider /> from 'import { CacheProvider } from "@emotion/react"'
23+
*
24+
* NOTE: The actual expected type is `React.Provider<EmotionCache>` but we use `Function` because
25+
* to make it work regardless of if you are using React 18 or React 19 type def.
26+
*/
27+
CacheProvider: Function = DefaultCacheProvider
2228
) {
2329
const { prepend, ...optionsWithoutPrependProp } = options;
2430

0 commit comments

Comments
 (0)