Skip to content

Commit ba5a663

Browse files
committed
refactor: 메인페이지 폰트 preload
issues: #29
1 parent 3421d74 commit ba5a663

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/app/root.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { ToastContainer } from 'react-toastify/unstyled';
1010
import type { Route } from './+types/root';
1111

1212
import './app.css';
13+
import { preload } from 'react-dom';
1314
import { Slide } from 'react-toastify';
1415
import StompProvider from './provider/StompProvider';
1516
import UserIdProvider from './provider/UserInfoProvider';
@@ -53,6 +54,19 @@ export function meta() {
5354
}
5455

5556
export function Layout({ children }: Readonly<{ children: React.ReactNode }>) {
57+
preload('/fonts/Pretendard-Medium.woff2', {
58+
as: 'font',
59+
crossOrigin: 'anonymous',
60+
});
61+
preload('/fonts/Pretendard-Regular.woff2', {
62+
as: 'font',
63+
crossOrigin: 'anonymous',
64+
});
65+
preload('/fonts/Pretendard-SemiBold.woff2', {
66+
as: 'font',
67+
crossOrigin: 'anonymous',
68+
});
69+
5670
return (
5771
<html lang="en">
5872
<head>

0 commit comments

Comments
 (0)