You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's an updated entry.client.tsx file for the remix-with-typescript example app, based on the latest Remix QuickStart and React 18 (using hyrdrateRoot as opposed to hydrate)
Not sure about entry.server.tsx yet as emotion does not support renderToPipeableStream?
importReact,{useState}from'react'import{RemixBrowser}from"@remix-run/react";import{startTransition,StrictMode}from"react";import{hydrateRoot}from"react-dom/client";import{CacheProvider}from'@emotion/react';import{ThemeProvider}from'@mui/material/styles';importCssBaselinefrom'@mui/material/CssBaseline';importClientStyleContextfrom'./ClientStyleContext';importcreateEmotionCachefrom'./createEmotionCache';importthemefrom'./theme';interfaceClientCacheProviderProps{
children: React.ReactNode;}functionClientCacheProvider({ children }: ClientCacheProviderProps){const[cache,setCache]=useState(createEmotionCache());constclientStyleContextValue=React.useMemo(()=>({reset(){setCache(createEmotionCache());},}),[],);return(<ClientStyleContext.Providervalue={clientStyleContextValue}><CacheProvidervalue={cache}>{children}</CacheProvider></ClientStyleContext.Provider>);}consthydrate=()=>{startTransition(()=>{hydrateRoot(document,<ClientCacheProvider><ThemeProvidertheme={theme}>{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}<CssBaseline/><StrictMode><RemixBrowser/></StrictMode></ThemeProvider></ClientCacheProvider>,);});};if(window.requestIdleCallback){window.requestIdleCallback(hydrate);}else{// Safari doesn't support requestIdleCallback// https://caniuse.com/requestidlecallbackwindow.setTimeout(hydrate,1);}
The text was updated successfully, but these errors were encountered:
hbjORbj
changed the title
Updated entry.client.tsx for remix-with-typescript example app
[system] Updated entry.client.tsx for remix-with-typescript example app
Nov 3, 2022
Would be happy to submit this as a PR as well...
Here's an updated
entry.client.tsx
file for the remix-with-typescript example app, based on the latest Remix QuickStart and React 18 (using hyrdrateRoot as opposed to hydrate)Not sure about
entry.server.tsx
yet as emotion does not supportrenderToPipeableStream
?emotion-js/emotion#2800
The text was updated successfully, but these errors were encountered: