fix: restore @ts-expect-error for CacheProvider type mismatch (#30171)
* fix: restore @ts-expect-error for CacheProvider type mismatch PR #30140 removed these comments assuming they were stale now that the repo is on TypeScript 5. The comments were about the compiler version, but the actual incompatibility is between react-inlinesvg/provider's CacheProvider (typed to return a bare ReactNode) and this repo's pinned @types/react@18.0.26, which requires JSX components to return Element | null. ReactNode includes undefined, so the JSX usage fails type-checking. Verified yarn build completes successfully with this restored. Fixes #30170 * docs: explain the actual @ts-expect-error compatibility condition Per @coderabbitai review on #30171: the old wording ("remove when upgrading typescript to v5") was itself stale/misleading, since the incompatibility is with the pinned @types/react version, not the TypeScript compiler version. Documents the real condition instead.
This commit is contained in:
@@ -27,6 +27,7 @@ export function Providers({ isEmbed, children, country }: ProvidersProps) {
|
||||
<TrpcProvider>
|
||||
<ToastProvider position="bottom-center">
|
||||
{!isEmbed && !isBookingPage && <NotificationSoundHandler />}
|
||||
{/* @ts-expect-error react-inlinesvg/provider is incompatible with @types/react@18.0.26. Remove when these types are compatible. */}
|
||||
<CacheProvider>
|
||||
<WebPushProvider>{children}</WebPushProvider>
|
||||
</CacheProvider>
|
||||
|
||||
@@ -17,6 +17,7 @@ function MyApp(props: AppProps) {
|
||||
return (
|
||||
<SessionProvider session={pageProps.session ?? undefined}>
|
||||
<WebPushProvider>
|
||||
{/* @ts-expect-error react-inlinesvg/provider is incompatible with @types/react@18.0.26. Remove when these types are compatible. */}
|
||||
<CacheProvider>
|
||||
{Component.PageWrapper ? <Component.PageWrapper {...props} /> : <Component {...pageProps} />}
|
||||
</CacheProvider>
|
||||
|
||||
Reference in New Issue
Block a user