Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.

Commit 9f75356

Browse files
committed
feat(Component): new name PreviewServerCSS to ServerStylePreview
1 parent 0e8e86a commit 9f75356

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

e2e/site/app/layout.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { PreviewServerCSS } from 'typedcssx/next';
1+
import { ServerStylePreview } from 'typedcssx/next';
22
import 'styles/typedcssx-global.css';
33

44
export default function RootLayout({ children }: { children: React.ReactNode }) {
55
return (
66
<html lang="en">
77
<head>
8-
<PreviewServerCSS anchorEnabled={true} />
8+
<ServerStylePreview />
99
</head>
1010
<body>{children}</body>
1111
</html>

next/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { PreviewServerCSS } from '../src/core/component/server-css';
1+
export { ServerStylePreview } from '../src/core/component/server-style-preview';

src/core/component/server-css.tsx renamed to src/core/component/server-style-preview.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { getServerCSS } from '../../_internal/utils/inject-server-css';
22
import { isDevServer } from '../../_internal/utils/helper';
3-
import { ReloadAnchorComponent } from './reload-link';
3+
import { RefreshOnNavigate } from './refresh-on-navigate';
44

5-
export const PreviewServerCSS = ({ anchorEnabled = false }: { anchorEnabled?: boolean }): JSX.Element | null => {
5+
export const ServerStylePreview = (): JSX.Element | null => {
66
if (!isDevServer) return null;
77

88
const serverCSS = getServerCSS();
99

1010
return (
1111
<>
12-
{anchorEnabled && <ReloadAnchorComponent />}
12+
<RefreshOnNavigate />
1313
<style dangerouslySetInnerHTML={{ __html: serverCSS }} />
1414
</>
1515
);

0 commit comments

Comments
 (0)