Skip to content

Layout Views

Layout views (defined by +layout.jsx) are components that are shared across multiple routes and are designed to wrap a page view. They are defined very similiarly to pages except they accept a children prop and “apply” to all child routes and a sibling page if the appropriate +page.jsx is defined.

src/routes/+layout.tsx
export default ({ children }) => {
return (
<>
<NavBar />
{children}
</>
)
}
src/routes/+layout.jsx
export default ({ children }) => {
return (<>
<NavBar />
{children}
</>)
}