-
Bug reportSWRConfig is used for top class components (e.g. layout), but the component Description / Observed Behavior
Expected BehaviorTherefore, the developer must write Additional Contextswr: 1.3.0 |
Beta Was this translation helpful? Give feedback.
Answered by
SukkaW
Dec 10, 2022
Replies: 1 comment
-
The current workaround would be manually wrapping // my-provider.client.tsx
'use client';
export const MyProvider = ({ children }: React.PropWithChildren<unknown>) => {
return <SWRConfig>{children}</SWRConfig>
};
// layout.tsx
export default function Layout({ children }: React.PropWithChildren<unknown>) {
return <MyProvider>{children}</MyProvider>
} And IMHO |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
promer94
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The current workaround would be manually wrapping
<SWRConfig />
in your client components:And IMHO
<SWRConfig />
should also includeimport 'client-only'
.