Skip to Content
Docs
Views
_app.tsx Layout

_app.tsx View

The views/_app.tsx view is a special kind of view. It’s always rendered as the wrapper around your entire frontend. It’s usually where you’d put your header/footer and other global elements.

import { defineView } from "eddev/views" import { Header } from "@components/site/Header" import { Footer } from "@components/site/Footer" import { ScrollRestoration } from "eddev/routing" export default defineView("_app", ({ children }) => { return ( <> <ScrollRestoration /> <AdminBar /> <Header /> {children} <Footer /> </> ) })

App Data

You can write a views/_app.graphql file, and the result will be available on every page, via the useAppData() hook. The result wont be passed in as props to the _app.tsx component, so be sure to use the hook if you need to access it.

See Global Data for more details.

Last updated on