fix: use fallbackData to prepare user data during SSR (#2968)

This commit is contained in:
Ryan Cohen
2022-08-23 17:36:02 +09:00
committed by GitHub
parent 3b2633812b
commit 6e60a275c7

View File

@@ -125,6 +125,9 @@ const CoreApp: Omit<NextAppComponentType, 'origGetInitialProps'> = ({
<SWRConfig
value={{
fetcher: (url) => axios.get(url).then((res) => res.data),
fallback: {
'/api/v1/auth/me': user,
},
}}
>
<LanguageContext.Provider value={{ locale: currentLocale, setLocale }}>