fix
Desc: - Perubahan pengambilan data dari API ke Function use server No issue
This commit is contained in:
@@ -1,31 +1,40 @@
|
||||
'use client';
|
||||
"use client";
|
||||
import AppNotif from "@/app_modules/notif";
|
||||
// import './globals.css'
|
||||
import { CacheProvider } from '@emotion/react';
|
||||
import { MantineProvider, useEmotionCache } from '@mantine/core';
|
||||
import { useServerInsertedHTML } from 'next/navigation';
|
||||
import { CacheProvider } from "@emotion/react";
|
||||
import { MantineProvider, useEmotionCache } from "@mantine/core";
|
||||
import { useServerInsertedHTML } from "next/navigation";
|
||||
import { ToastContainer, toast } from "react-toastify";
|
||||
import "react-toastify/dist/ReactToastify.css";
|
||||
|
||||
export default function RootStyleRegistry({ children }: { children: React.ReactNode }) {
|
||||
const cache = useEmotionCache();
|
||||
cache.compat = true;
|
||||
export default function RootStyleRegistry({
|
||||
children,
|
||||
}: {
|
||||
children: React.ReactNode;
|
||||
}) {
|
||||
const cache = useEmotionCache();
|
||||
cache.compat = true;
|
||||
|
||||
useServerInsertedHTML(() => (
|
||||
<style
|
||||
data-emotion={`${cache.key} ${Object.keys(cache.inserted).join(' ')}`}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: Object.values(cache.inserted).join(' '),
|
||||
}}
|
||||
/>
|
||||
));
|
||||
useServerInsertedHTML(() => (
|
||||
<style
|
||||
data-emotion={`${cache.key} ${Object.keys(cache.inserted).join(" ")}`}
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: Object.values(cache.inserted).join(" "),
|
||||
}}
|
||||
/>
|
||||
));
|
||||
|
||||
return (
|
||||
<html lang='en' data-theme="light" >
|
||||
<body suppressHydrationWarning={true} >
|
||||
<CacheProvider value={cache}>
|
||||
<MantineProvider withGlobalStyles withNormalizeCSS>
|
||||
{children}
|
||||
</MantineProvider>
|
||||
</CacheProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
return (
|
||||
<html lang="en" data-theme="light">
|
||||
<body suppressHydrationWarning={true}>
|
||||
<CacheProvider value={cache}>
|
||||
<MantineProvider withGlobalStyles withNormalizeCSS>
|
||||
{children}
|
||||
<ToastContainer position="bottom-center" />
|
||||
<AppNotif />
|
||||
</MantineProvider>
|
||||
</CacheProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user