MCPcopy Create free account
hub / github.com/code-forge-io/react-router-devtools / App

Function App

docs/app/root.tsx:40–65  ·  view source on GitHub ↗
({ loaderData }: Route.ComponentProps)

Source from the content-addressed store, hash-verified

38}
39
40export default function App({ loaderData }: Route.ComponentProps) {
41 const { lang, clientEnv } = loaderData
42 useChangeLanguage(lang)
43 const fontFaceRules = fonts
44 .map(
45 (font) => `
46 @font-face {
47 font-family: "${font.fontFamily}";
48 font-style: ${font.fontStyle};
49 font-weight: ${font.fontWeight};
50 src: url(${font.src}) format("truetype");
51 font-display: swap;
52 }
53 `
54 )
55 .join("\n")
56 return (
57 <>
58 <Outlet />
59 {/* biome-ignore lint/security/noDangerouslySetInnerHtml: We set the window.env variable to the client env */}
60 <script dangerouslySetInnerHTML={{ __html: `window.env = ${JSON.stringify(clientEnv)}` }} />
61 {/* biome-ignore lint/security/noDangerouslySetInnerHtml: fonts loading*/}
62 <style dangerouslySetInnerHTML={{ __html: fontFaceRules }} />
63 </>
64 )
65}
66
67export const Layout = ({ children }: { children: React.ReactNode }) => {
68 const { i18n } = useTranslation()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected