-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(refine-remix): update to
remix@2
and `@refinedev/remix-router…
…@3` (#382) * chore(refine-remix): update to v2 * chore: update custom server configurations * fix: node version for CI --------- Co-authored-by: Batuhan Wilhelm <[email protected]>
- Loading branch information
Showing
17 changed files
with
265 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
import createCache from '@emotion/cache' | ||
import createCache from "@emotion/cache"; | ||
|
||
export default function createEmotionCache() { | ||
return createCache({ key: 'css' }) | ||
} | ||
return createCache({ key: "cha" }); | ||
} | ||
|
||
export const defaultCache = createEmotionCache(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,35 @@ | ||
import React, { useState } from 'react' | ||
import { hydrateRoot } from 'react-dom/client' | ||
import { CacheProvider } from '@emotion/react' | ||
import { RemixBrowser } from '@remix-run/react' | ||
|
||
import { ClientStyleContext } from './context' | ||
import createEmotionCache from './createEmotionCache' | ||
import { CacheProvider } from "@emotion/react"; | ||
import { RemixBrowser } from "@remix-run/react"; | ||
import React, { startTransition, StrictMode } from "react"; | ||
import { hydrateRoot } from "react-dom/client"; | ||
import { ClientStyleContext } from "./context"; | ||
import createEmotionCache, { defaultCache } from "./createEmotionCache"; | ||
|
||
interface ClientCacheProviderProps { | ||
children: React.ReactNode; | ||
children: React.ReactNode; | ||
} | ||
|
||
function ClientCacheProvider({ children }: ClientCacheProviderProps) { | ||
const [cache, setCache] = useState(createEmotionCache()) | ||
const [cache, setCache] = React.useState(defaultCache); | ||
|
||
function reset() { | ||
setCache(createEmotionCache()) | ||
} | ||
function reset() { | ||
setCache(createEmotionCache()); | ||
} | ||
|
||
return ( | ||
<ClientStyleContext.Provider value={{ reset }}> | ||
<CacheProvider value={cache}>{children}</CacheProvider> | ||
</ClientStyleContext.Provider> | ||
) | ||
return ( | ||
<ClientStyleContext.Provider value={{ reset }}> | ||
<CacheProvider value={cache}>{children}</CacheProvider> | ||
</ClientStyleContext.Provider> | ||
); | ||
} | ||
|
||
hydrateRoot( | ||
document, | ||
<ClientCacheProvider> | ||
<RemixBrowser /> | ||
</ClientCacheProvider> | ||
) | ||
startTransition(() => { | ||
hydrateRoot( | ||
document, | ||
<StrictMode> | ||
<ClientCacheProvider> | ||
<RemixBrowser /> | ||
</ClientCacheProvider> | ||
</StrictMode>, | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* By default, Remix will handle hydrating your app on the client for you. | ||
* You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ | ||
* For more information, see https://remix.run/file-conventions/entry.client | ||
*/ | ||
|
||
import { ClientProvider } from "@mantine/remix"; | ||
import { RemixBrowser } from "@remix-run/react"; | ||
import { startTransition, StrictMode } from "react"; | ||
import { hydrateRoot } from "react-dom/client"; | ||
|
||
startTransition(() => { | ||
hydrateRoot( | ||
document, | ||
<StrictMode> | ||
<ClientProvider> | ||
<RemixBrowser /> | ||
</ClientProvider> | ||
</StrictMode>, | ||
); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 4 additions & 24 deletions
28
refine-remix/plugins/mui/app/contexts/ColorModeContext.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,18 @@ | ||
/** | ||
* By default, Remix will handle hydrating your app on the client for you. | ||
* You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨ | ||
* For more information, see https://remix.run/file-conventions/entry.client | ||
*/ | ||
|
||
import { RemixBrowser } from "@remix-run/react"; | ||
import { startTransition, StrictMode } from "react"; | ||
import { hydrateRoot } from "react-dom/client"; | ||
|
||
hydrateRoot(document, <RemixBrowser />); | ||
startTransition(() => { | ||
hydrateRoot( | ||
document, | ||
<StrictMode> | ||
<RemixBrowser /> | ||
</StrictMode>, | ||
); | ||
}); |
Oops, something went wrong.