rsnext/test/e2e/app-dir/metadata/app/layout.tsx
Jiachi Liu a28ae633e4
Support metadata exports for server components not-found (#52678)
### What?

Support metadata exports for `not-found.js` conventions

### Why?

We want to define metadata such as title or description basic properties for error pages, including 404 and 500 which referrs to `error.js` and `not-found.js` convention. See more requests in #45620 

Did some research around metadata support for not-found and error convention. It's possible to support in `not-found.js` when it's server components as currently metadata is only available but for `error.js` it has to be client components for now so it's hard to support it for now as it's a boundary.

### How?

We determine the convention if we're going to render is page or `not-found` boundary then we traverse the loader tree based on the convention type. One special case is for redirection the temporary metadata is not generated yet, we leave it as default now.

Fixes #52636
2023-07-14 22:33:47 +00:00

14 lines
285 B
TypeScript

export default function Layout({ children }) {
return (
<html>
<head></head>
<body>{children}</body>
</html>
)
}
export const metadata = {
title: 'this is the layout title',
description: 'this is the layout description',
keywords: ['nextjs', 'react'],
}